This may also work for non-Intel cards, so feel free to try it if your wifi is slow. The directions are the same for Intel or other cards.
While Linux Mint and the other members of the Ubuntu Linux family have done a great job of configuring everything with the appropriate driver right out of the box (meaning as soon as Linux was done installing, before I started changing the default settings) every time I’ve installed Linux in recent years, there was one issue that was really annoying, and I thought I’d share how I fixed it with the good readers of AskWoody.com.
I have several laptops with wireless networking (wifi) capability, and out of the box, they’ve always worked, but not as quickly as in Windows. All of them use Intel wifi adapters… my Core 2 Duo laptop uses an Intel 7260 AGN (dual band without Bluetooth) MiniPCIE card, while my Dell laptop with Celeron N3060 uses an Intel 7265 AGN+AC (dual band with Bluetooth) M.2 card. Those were not the original wifi cards in either of them, but upgrading wireless cards is easy and cheap (tons of cards on eBay for under $10), so why not?
In Windows, the new 7265 card I put in the Dell ran at the full expected speed right from the get-go, but in Linux, it was actually slower than the supposedly “half as fast” card it had replaced. That was… annoying!
Meanwhile, I have a faint memory of the same slow speed being a problem when I first installed Linux on the Core 2 Duo laptop, but when I tested it now, it was fast– actually besting its performance in Windows by a little bit. The 7260 and 7265 cards are very similar, and I am using the same version of Linux on both, so what did I change that fixed it on the older laptop?
Searching the internet for “slow wifi” and other related things turned up a lot of stuff, and sorting through the outdated or irrelevant information can be frustrating. I did find some answers, though.
First of all, don’t use file copying from a Samba or Windows networking share as a measure of the wifi speed. On most Linux systems, the automounting of a network share is handled by GVFS (Gnome Virtual File System, which was using that name for about a decade before MS came along and clumsily named something else the very same thing), and GVFS is slooooooow in copying from network shares on the client end.
To get a better measure, I connected to my backup server’s FTP server (FileZilla) from Waterfox and downloaded some large files. This did effectively max out the wifi connection and give a good report of the actual speed. I got 22 MB/s in Windows and 24 MB/s in Linux on the 7260; on the 7265, I got 22 MB/s in Windows but only ~10 MB/s in Linux, with great variability (swinging back and forth between ~6 and ~14 MB/s), and sometimes not even that. This is on the 5 GHZ “A” band, with no other detected networks impinging on the 40MHz channel I used.
Most people probably won’t want to install a FTP server on a network computer just to test the wifi speed. I happened to have it already set up (since the PC it is on is a backup server anyway), so that was easy. Otherwise, you’d have to find a benchmark program you could install on a remote PC (another one on the network) as well as on the one with the slow wifi to get a good measure of the speed. If you’re lucky enough to have internet fast enough to max out your wifi, you can try using that.
So, back to troubleshooting the slowness.
One of the answers suggested (that a lot of people said was helpful) was to disable the N mode in the card using a certain command. I don’t know if it truly disables all of the N features or just the 40MHz bonded channel mode (two 20MHz channels used as one), but I didn’t replace the wifi card just to turn it back into the card it replaced (or worse). I also knew that a very similar card performs as well or better in Linux as in Windows, so I was not going to try that “fix.”
I tried checking the “firmware” (binary blob from Intel) to make sure it was the latest version, and it was. I checked the Linux performance tuning TCP parameters, and they were fine. I found out that my card was not registered to the US regulatory domain, so it was operating with “safe” international parameters that didn’t let it transmit at full power, but fixing that (I will have to make a separate post about fixing that) didn’t fix the problem (it may have helped a little, but it didn’t cure it).
Finally, I stumbled across a web page that suggested turning off the wifi power saving mode, and it triggered a faint memory of something I’d done with the older laptop that delivered great performance over its Linux wifi.
I issued the command on the laptop with the slow wifi (into the terminal, the Linux name for what Windows calls the command prompt):
iwconfig
That shows a list of the wireless devices on the PC with some of the more important bits of info for each card. As expected, the slow wifi laptop showed Power Management: on for its wifi card. It’s a laptop, so when it is on battery, it’s good to be able to save as much power as possible, so having that on would usually seem to be a good thing.
I issued the same command on the fast wifi laptop, and…. Power Management: off. Mmm, I may be on to something!
To turn power management off, we need to know the name Linux knows the card by. It’s not shown in the iwconfig info. This command will give you the info you need in Mint and other Ubuntu relatives:
sudo lshw -class network
“ls” in Linux means list. ‘ls’ by itself is the equivalent of ‘dir’ in Windows, listing the files in the current working directory. ‘lshw’ means list hardware. ‘lspci’ lists PCI devices on the computer, while ‘lsusb’ lists USB devices, and so on. The -class network is pretty obvious; without that switch, lshw would list all the hardware, and we’d have to scroll through a ton of stuff to find what we need. ‘sudo’ means to run the command that follows as a superuser, also known as administrator or root, which ensures that the lshw command has access to all the hardware info.
After entering the password for the sudo, scroll down through the info it provides and find the one that says “description: Wireless interface,” which on the Dell is the only one listed (it has no ethernet port), and a few lines under that it should say “logical name: wlp1s0”, where the actual name of your card replaces wlp1s0.
It used to be that the first wifi card enumerated by the system would be called wlan0 (or ath0 for Atheros cards), but since it was never certain which order things would be enumerated in if there were multiples of something, they changed it so that things had more unique names that would stick with the device regardless of enumeration order, and that’s the one my 7265 ended up with. That’s the situation in Mint 18.3, anyway; I don’t know about other Linuxes.
So, now that you know the Linux name of the card, enter (substituting the name of your card for wlp1s0):
sudo iwconfig wlp1s0 power off
After that, iwconfig should show that power management is off. Try the speed test again, and you should find a big improvement.
Note that this is not a permanent fix. The next time you reboot, it will go back to the way it was, with power management on. If turning it off worked and you want to make it permanent in a distro that, like Mint, uses NetworkManager, there’s an easy way:
sudo xed /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
xed is the text editor in Mint 18.3 Cinnamon. If you are using another version of Linux, substitute what your text editor is named for xed (pluma if you are using a Mate desktop, kate/kwrite/kedit for KDE, etc.).
In that file, look for wifi.powersave = 3. Change the 3 to a 2, then save the file.
Of course, then the filename says “powersave on” even though it contains the command to turn power saving off, which didn’t seem like a good idea to me, since I might later forget what it is supposed to mean. I’m no Linux expert, but I’ve noticed that directories (folders) that end in .d usually contain .conf files that are all obeyed in a certain order (sometimes they are preceded by numbers, like 20-whatever.conf, which would be obeyed before 3o-whatever-else.conf, and so on, up to 99). So I tried changing the name from default-wifi-powersave-on.conf to default-wifi-powersave-off.conf (using the Mint GUI, just right click and select rename from an elevated/root Nemo (file manager) window, which you can get by first right clicking the background and selecting “Open as root”.
I rebooted to be sure, and iwconfig still shows power management as off, so it looks like the name change didn’t affect anything. Whether or not you rename the file, a reboot will let you know if it is going to persist as intended or not.
That should do it.
It appears that the iwlwifi driver (the driver for all of the newer Intel wireless adapters) has a bug in power management that kills its throughput. It’s been an issue for a long time, as you can see in how far back the messages from people asking for help go, but with the limited resources in Linux, these kinds of things happen sometimes, unfortunately. It may be Intel’s binary blobs that are at fault, and since those are closed-source, there would be no way to fix it until Intel decides to do it themselves.
How this will affect battery life, I do not know yet. For me, the full speed of the wifi connection is only needed when doing LAN stuff like transferring files over the network. Even the slow performance with power management enabled is good enough for most public wifi internet connections, and certainly for my own home internet connection, and that’s the main purpose of the laptop when I am not at my desk (where the laptop is likely plugged in, so the slight increase in power consumption by the wifi adapter won’t make any difference), so I may end up with some kind of a script to turn power management back on when the laptop goes on battery power.
Dell XPS 13/9310, i5-1135G7/16GB, KDE Neon 6.2
XPG Xenia 15, i7-9750H/32GB & GTX1660ti, Kubuntu 24.04
Acer Swift Go 14, i5-1335U/16GB, Kubuntu 24.04 (and Win 11)