Slow wifi on Ubuntu/Debian


Has anyone experienced issues with wifi “speed” on Ubuntu/Debian images? On speedtest-cli, the speed is fine ( around 200Mbs ) but, on ping from the local network, I have a reponse around 350ms and also ssh is working very slow, with a lot of lag. This problem i have on two new rock960 boards , one in my home and one in a friend’s home. I can put more info about this , but I’m wondering if anyone else had this behavior.


Since it’s not a throughput issue but seems to be a latency issue with sporadic packets, I bet it’s due to 802.11 power-save. This mechanism which is part of the WiFi specification allow to suspend the radio between AP beacons (which is usually every 100ms), this allows to save power but increase the latency. The client usually exit PS mode on packet reception and re-enter it if no packet received for a certain time (~500ms/1s).

I assume it can be a bit frustrating when using ssh since PS mode will need to be exited each time you type a letter (if no other traffic), but hey, you just need to type faster than the PS trigger :wink:

The following command is supposed to disable PS mode:

iw dev wlan0 set power_save off

and get the state with:

iw dev wlan0 get power_save

Let us know if it works.


Thanks Loic. Last night , after the post, i digged a little bit the same problem on other devices on ubuntu, and I came to the same conclusion. I will try it as u said, and came later with the result.
Thanks again for your so fast answer.


Sorry for the delay, but i din’t have time to try it before.
I’ve tried :iw dev wlan0 set power_save off
Is working just for a few seconds and after that the power management is on again.

After a lot of searching and trying some solutions. The only one that worked is this

iwconfig wlan0 power off.

What has to be done, is to add the following line into /etc/rc.local file ( above the ‘exit 0’ line)

(sleep 30 && iwconfig wlan0 power off) &

The command execution has to be delayed ( 30 seconds), because something , don’t know exactly what, is making the power saving be on again.

Even if you run

iw dev wlan0 get power_save

you will see that the power management shows that is on, but actually is not making any problem anymore.

Instead, If you’ll run

iw dev wlan0 set power_save off

after the

iwconfig wlan0 power off

the problems appear again. So what I found was just that solution with iwconfig command.

P.S. I’ve tried also solutions with /etc/pm/power.d/wireless (you will find a lot on the net) and others but neither worked for me. I don’t think this is the best clean solution, but this makes the work done.


Thanks for the feedback and solution.

Yes, I have same behavior on my side, it looks like a bug for me.