Score:0

Why does internet seem so slow on ubuntu?

pm flag

I recently switched Ubuntu 20.04 from Windows 10 and I have been experiencing very slow wifi internet connection ever since. Speedtest shows me that my download speed is a 1/4 of what it used to on Windows.

I tried changing my mtu from 1500 to 1492 but it didn't solve it.

I'm using a wireless usb adapter.

output of lsusb:

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 1038:0617 SteelSeries ApS SteelSeries Apex M750 TKL
Bus 001 Device 004: ID 1532:0504 Razer USA, Ltd Razer Kraken 7.1 Chroma
Bus 001 Device 003: ID 046d:c08c Logitech, Inc. G PRO Gaming Mouse
Bus 001 Device 006: ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Pilot6 avatar
cn flag
A lot more information is needed. How you are connected to internet?
Alejo Ordoñez avatar
pm flag
I am connected via wifi
Pilot6 avatar
cn flag
Please [edit] your question and add output of `lspci -knn | grep Net -A3` terminal command.
Alejo Ordoñez avatar
pm flag
I don't get any output after running that command
Pilot6 avatar
cn flag
Are you using a USB adapter?
Alejo Ordoñez avatar
pm flag
Yes, I am using a USB adapter
Pilot6 avatar
cn flag
Post output of `lsusb` then.
Alejo Ordoñez avatar
pm flag
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 005: ID 1038:0617 SteelSeries ApS SteelSeries Apex M750 TKL Bus 001 Device 004: ID 1532:0504 Razer USA, Ltd Razer Kraken 7.1 Chroma Bus 001 Device 003: ID 046d:c08c Logitech, Inc. G PRO Gaming Mouse Bus 001 Device 006: ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
vidarlo avatar
om flag
What speeds are you actually seeing?
Alejo Ordoñez avatar
pm flag
download: 2.53 Mbps, it used to be 10 Mbps when I used windows
Pilot6 avatar
cn flag
Do you know the difference between megabits and megabytes? :-)
Score:-1
it flag

Check your WiFi MTU, using

ip link

or

ip l | grep $(ip r | awk '/default/ {print $5}' ) | awk '{print $2, $4, $5}'

also notice your WiFi interface's name.

The MTU (Maximum Transmission Unit) is the size of the largest packet that can be sent in a single network transmission. If a packet exceeds the MTU of a link, the data must be split into multiple packets (fragmented). These multiple packets must be sent over the link, received, acknowledged, and reassembled at the far end. If your link is misconfigured, and you have to fragment every packet you send, your actual data transfer rate drops.

Ethernet (wired) networks use an MTU of 1500 bytes.

Due to additional per packet overhead for WiFi (8 bytes PPPoE header), WiFi uses an MTU of 1492.

Your MTU should be set by your DHCP server, check your router's config.

You can set your own MTU (setting does not persist over restarts) with

sudo ip link set dev name mtu 1492

where "name" is the interface name from above.

Here's an example:

walt@squid:~(0)$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp63s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:24:21:7f:e5:1c brd ff:ff:ff:ff:ff:ff
3: wlxf46d04b1790f: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000
    link/ether f4:6d:04:b1:79:0f brd ff:ff:ff:ff:ff:ff
walt@squid:~(0)$   sudo ip link set dev wlxf46d04b1790f mtu 1492
[sudo] password for walt: 
walt@squid:~(0)$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp63s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:24:21:7f:e5:1c brd ff:ff:ff:ff:ff:ff
3: wlxf46d04b1790f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1492 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether f4:6d:04:b1:79:0f brd ff:ff:ff:ff:ff:ff

My WiFi "interface name" is "wlxf46d04b1790f".

Pilot6 avatar
cn flag
It depends on a lot of things. MTU is very rarely a problem.
waltinator avatar
it flag
@Pilot6 MTU is often the problem. With the default MTU of 1500, when using WiFi, the PPPoE header subtracts 8 bytes, and your 1500 byte packet is fragmented into a 1492 byte packet and an 8 byte packet, thus doubling packet overhead and the number of packets sent. WiFi routers should set the MTU to 1492 via DHCP, but many don't.
Pilot6 avatar
cn flag
This should be handled by a router. And OP never mentioned PPPoE.
waltinator avatar
it flag
@Pilot6 "should" not equal to "does". OP mentioned WiFi (in a comment). Using my experience (since 1967), I checked my mental list of Solved Problems, and picked the most likely. How many "slow WiFi" problems have you solved that weren't MTU? WiFi works by using PPPoE (Point-to-Point Protocol over Ethernet), and wrapping your packet in a PPPoE packet to get it to the WiFi router.
Alejo Ordoñez avatar
pm flag
I checked and my mtu was set to 1500, I changed it to 1492 but it doesn't seem to work.
vidarlo avatar
om flag
@waltinator That's wrong. WiFi do ***not*** use PPPoE. WiFi supports 1500 byte MTU just fine. The reason for using MTU of 1492 is PPPoE-header, but that would be the header on the upstream PPPoE commonly used for DSL connections, and would apply no matter what access technology.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.