How to solve WIFI with high ping in LAN

I was using TightVNC viewer and server between two PCs in LAN environment. For unknown reason, the connection speed becomes excruciatingly slow, sometimes can't establish and maintain connection at all.

The ping command shows that it takes 20ms to 80ms on average when ping from client to the server. The average time is 2ms when ping from server to client. Ping from server to gateway take 1ms or 0ms on average, the output shows there are several <1ms items which makes the average 0ms.

The server connects to a switch with a cable while the client first connects to a wireless router, the router then connects to a switch with cable. Obviously the problem is the wireless connection between client and the router. This is clear when I activated another wired adapter on the client and directly connected it to the switch, the average ping latency immediately went as low as 0ms to 1ms.

It turns out that the wireless adapter will constantly scan for the available wireless networks in range, so you can see a list of WIFI sources when you click the icon in the taskbar. The scanning goes on even you already connected to one of them and in many cases, always connects to the same one which is the router right beside the PC. It is this scanning process the cause of the high ping as we observed.

There are two solutions for this problem. A temporary solution is to stop the WLAN AutoConfig service and restart it. Since the scanning is still running, the problem may occurs again. You have to restart the service again.

Another solution is run command netsh wlan set autoconfig enabled=no interface="Wireless Network Connection", the interface name can be found in the output of netsh wlan show settings. This will disable the scanning, the problem will not reoccur as long as the connection is kept. But on the flip side, you have to enable it whenever you need to reconnect. To enable the scanning run the command netsh wlan set autoconfig enabled=yes interface="Wireless Network Connection". After the connection is established, you can disable it for the sake of low ping.

When nothing above works or you are sick of being disrupted, tired of constantly restarting service or changing configuration, there is the final solution: use a cable. When it comes to stableness, a wireless connection never competes with physical wire. The trade-off is the convenience, but all the hassles come from wireless connection will be gone forever.