Tag Archives: Linux

Slow wifi network on Linux laptop

wifi on Linux laptop

If network performance on your laptop is slow and unstable, it might be because power management of your wifi adapter and of Linux are not playing together.

One of the things you will notice are flapping ping rates:

$ ping 
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=23.3 ms
64 bytes from icmp_seq=2 ttl=64 time=44.7 ms
64 bytes from icmp_seq=3 ttl=64 time=1161 ms
64 bytes from icmp_seq=4 ttl=64 time=35.2 ms
--- ping statistics ---
30 packets transmitted, 20 received, 33% packet loss, time 30000.14s
rtt min/avg/max/mdev = 23.3/537.9/2119.2/2005.3 ms

As you can see the 3rd ping has a high round trip time of over one second. You might also notice high packet loss rates.

If this is the case and your hardware seems to be ok, you can try to switch off Network Manager's automatic power management in /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf:

wifi.powersave = 2

Restart NetworkManager (sudo systemctl restart NetworkManager) or reboot your Laptop.

If you are not using NetworkManager, you can try to switch off power management directly:

sudo iwconfig wlp2s0 txpower fixed

Afterwards check that power management is really disabled:

sudo iwconfig wlp2s0
Power Management:off

Useful ntp server configuration settings

All configuration settings go into /etc/ntp.conf.

Limiting ntp server to one network interface (plus localhost):

interface ignore wildcard
interface listen eth0

Make local hardware clock work as a backup ntp source with high stratum (set it to 0 if local hardware clock is set by some other external time source):

fudge stratum 8

Never give up synchronising even if clock difference is very large:

tinker panic 0

Increase the number of candidate servers (default 3 -> 5) and servers used by the selection algorithm to set the system clock (default 1 -> 2):

tos minclock 5
tos minsane 2