Ubuntu 20.04 Network Performance Extremely Slow

I just upgraded from Ubuntu 18.04 to 20.04 on one of the Dell XPS 13 machines, and the network performance is abhorrent. Internet speed is very fast from a google speed test (>300Mb/s for both upload and download).

However, whenever I try to browse a website or even run sudo apt update the connection will often time out. My internet is very fast on all other devices and I really don't know how to debug this problem.

sudo lshw -class network -short && nmcli device status 

shows

H/W path           Device           Class          Description
==============================================================
/0/100/1c.6/0      wlp2s0           network        Wi-Fi 6 AX200
/3                 br-96f5b790e29e  network        Ethernet interface
/4                 br-15e76fb81c05  network        Ethernet interface
/5                 docker0          network        Ethernet interface

DEVICE           TYPE      STATE         CONNECTION      
wlp2s0           wifi      connected     CSA HQ          
br-15e76fb81c05  bridge    connected     br-15e76fb81c05 
br-96f5b790e29e  bridge    connected     br-96f5b790e29e 
docker0          bridge    connected     docker0         
p2p-dev-wlp2s0   wifi-p2p  disconnected  --              
lo               loopback  unmanaged     --              
gpd0             tun       unmanaged     --             

Solution:

It seems like this is a pretty common problem, and one without a definitive cause. For me, it was because Ubuntu resets the TLP configuration, and the power management went back to "on". I disabled Wi-Fi power management directly by editing:

sudo nano /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf

Then changed the value from 3 to 2, saved changes and rebooted.

I actually got this solution from Reddit and this worked for my case specifically but it seems like it could be caused by a bunch of other things. Read all the proposed solutions below!


Solution 1:

The top voted answer didn't solve it for me and I got this solution from a different source.

This was because Ubuntu resets the TLP configuration when I upgraded from 18.04 to 20.04, and the power management went back to "on". I disabled wifi power management directly by editing /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf and changed the value from 3 to 2, saved changes and rebooted.

Solution 2:

could be the "backport-iwlwifi-dkms" package

I experienced a better performance without this package, so i suggest to remove it

$ sudo apt remove backport-iwlwifi-dkms

this is a known bug

https://bugs.launchpad.net/ubuntu/+source/backport-iwlwifi-dkms/+bug/1869588

Solution 3:

I was having the same problem with slow wireless internet speed and what worked for me was to follow the steps proposed in the following post:

Very slow internet connection on ubuntu 16.04

Basically, I edited the file /etc/gai.conf as super user:

sudo nano /etc/gai.conf

Then I looked for the line with precedence ::ffff:0:0/96 100 and removed the # character that preceded it. I had to reboot my system for it to take effect. It worked like a charm.

The funny thing is that when I was using Ubuntu 20.04 Beta, this problem did not happen. Later, when I installed the LTS version, I started having this problem.

Solution 4:

Thanks a lot for all information you provided above.

Here I want to tell you about my situation.

I have an XPS-13-9360 (i7-8550U,16G,1T) and manually installed a killer 1650 (aka. intel ax 200). I was facing the same issue, extremely slow wireless connection.

And it seems that the problem has been solved since I installed a linux-5.6.7-generic kernel. (While the last one was 5.4.0-low-latency, I don't know why I installed low latency version, all that I did was do-release-upgrade from Ubuntu 19.10 with 5.3 kernels).

Here I recommend that you install a generic kernel instead of all one (by uname -sr, you can see what kind of kernel you are using), and upgrade to a newer kernel if possible.

BTW, I didn't sacrifice WiFi 6 and it seems OK with Linux 5.6.7

Bests, Leon

Solution 5:

Also updated from Ubuntu 18.04 to 20.04 on a Dell XPS 7390, had the same problem, and the accepted solution worked well for a bit (see comments):

sudo nano /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf

I would just add for any other newbies like me that Ctrl + o and then Enter saves the changes made, and Ctrl + x then exits nano mode (https://wiki.gentoo.org/wiki/Nano/Basics_Guide). While here, Ctrl + Alt + t is how you open the terminal where you'd enter all these commands.

My current download speed (compared to a Win10 machine on the same desk) is 87 Kbps (vs. 19Mbps), and upload is 6.7 Mbps (vs. 8.5Mbps).