Slow WiFi download speed

Looking for some advice troubleshooting my slow wifi connection.

I have a desktop and a raspberrypi both connected to a router via wifi.
When downloading a file from a remote server (rsync via ssh in case it’s important), raspberrypi gets about 5-5.5 MB/s, but on the PC the speed won’t go above 500 kB/s.

Things I have tried without any noticeable difference:

  1. Switching from wpa_supplicant to iwd
  2. Using 2.4Ghz instead of 5Ghz on the PC (pi uses 2.4GHz)
  3. Fiddling with iwlwifi settings:
cat /etc/modprobe.d/iwlwifi.conf                                                                                                                                                                                     
options iwlwifi swcrypto=1 11n_disable=1 bt_coex_active=0

Anything else I can check to troubleshoot this?


 inxi -N                                                                                                                                                                   
 Network:
  Device-1: Intel Dual Band Wireless-AC 3168NGW [Stone Peak] driver: iwlwifi
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    driver: r8168
lshw -C network

  *-network                 
       description: Wireless interface
       product: Dual Band Wireless-AC 3168NGW [Stone Peak]
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:29:00.0
       logical name: wlan0
       version: 10
       serial: 9c:29:76:c1:cf:32
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=6.1.25-1-MANJARO firmware=29.198743027.0 3168-29.ucode ip=192.168.1.77 latency=0 link=yes multicast=yes wireless=IEEE 802.11
       resources: irq:82 memory:fc600000-fc601fff
inxi -Fazy                                                                                                                                                                                                                  

System:
  Kernel: 6.1.25-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1-x86_64
    root=UUID=41842a12-6b2a-4b25-b1af-237f1d287cf0 rw quiet apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: KDE Plasma v: 5.27.4 tk: Qt v: 5.15.8 wm: kwin_x11 vt: 1 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop Mobo: Micro-Star model: B550M PRO-VDH WIFI (MS-7C95) v: 1.0
    serial: <superuser required> UEFI: American Megatrends LLC. v: 2.A0
    date: 03/16/2022
CPU:
  Info: model: AMD Ryzen 5 5600X bits: 64 type: MT MCP arch: Zen 3+ gen: 4
    level: v3 note: check built: 2022 process: TSMC n6 (7nm) family: 0x19 (25)
    model-id: 0x21 (33) stepping: 0 microcode: 0xA201016
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 3 MiB desc: 6x512 KiB L3: 32 MiB
    desc: 1x32 MiB
  Speed (MHz): avg: 2727 high: 3700 min/max: 2200/4650 boost: enabled
    scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 3599 2: 3700
    3: 2877 4: 2200 5: 2200 6: 2200 7: 3600 8: 2200 9: 2200 10: 2876 11: 2880
    12: 2200 bogomips: 88827
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW,
    STIBP: always-on, RSB filling, PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GP108 [GeForce GT 1030] vendor: ASUSTeK driver: nvidia
    v: 530.41.03 alternate: nouveau,nvidia_drm non-free: 530.xx+
    status: current (as of 2023-03) arch: Pascal code: GP10x process: TSMC 16nm
    built: 2016-21 pcie: gen: 3 speed: 8 GT/s lanes: 4 bus-ID: 2b:00.0
    chip-ID: 10de:1d01 class-ID: 0300
  Display: x11 server: X.Org v: 21.1.8 compositor: kwin_x11 driver: X:
    loaded: nvidia gpu: nvidia display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3840x1080 s-dpi: 92 s-size: 1060x301mm (41.73x11.85")
    s-diag: 1102mm (43.38")
  Monitor-1: DVI-D-0 pos: left res: 1920x1080 hz: 60 dpi: 93
    size: 527x296mm (20.75x11.65") diag: 604mm (23.8") modes: N/A
  Monitor-2: HDMI-0 pos: primary,right res: 1920x1080 hz: 60 dpi: 93
    size: 527x296mm (20.75x11.65") diag: 604mm (23.8") modes: N/A
  API: OpenGL v: 4.6.0 NVIDIA 530.41.03 renderer: NVIDIA GeForce GT
    1030/PCIe/SSE2 direct-render: Yes
Audio:
  Device-1: NVIDIA GP108 High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel bus-ID: 3-2:3 v: kernel chip-ID: 045e:070f pcie:
    class-ID: 0300 gen: 3 speed: 8 GT/s lanes: 4 bus-ID: 2b:00.1
    chip-ID: 10de:0fb8 class-ID: 0403
  Device-2: AMD Starship/Matisse HD Audio vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: 2d:00.4 chip-ID: 1022:1487 class-ID: 0403
  Device-3: Microsoft LifeChat LX-3000 Headset type: USB
    driver: hid-generic,snd-usb-audio,usbhid
  API: ALSA v: k6.1.25-1-MANJARO status: kernel-api with: aoss
    type: oss-emulator tools: alsamixer,amixer
  Server-1: JACK v: 1.9.22 status: off tools: N/A
  Server-2: PipeWire v: 0.3.70 status: off with: pipewire-media-session
    status: active tools: pw-cli
  Server-3: PulseAudio v: 16.1 status: active with: pulseaudio-jack
    type: module tools: pacat,pactl
Network:
  Device-1: Intel Dual Band Wireless-AC 3168NGW [Stone Peak] driver: iwlwifi
    v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 bus-ID: 29:00.0
    chip-ID: 8086:24fb class-ID: 0280
  IF: wlan0 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Micro-Star MSI driver: r8168 v: 8.050.03-NAPI modules: r8169 pcie:
    gen: 1 speed: 2.5 GT/s lanes: 1 port: f000 bus-ID: 2a:00.0
    chip-ID: 10ec:8168 class-ID: 0200
  IF: enp42s0 state: down mac: <filter>
Bluetooth:
  Device-1: Intel Wireless-AC 3168 Bluetooth type: USB driver: btusb v: 0.8
    bus-ID: 1-9:4 chip-ID: 8087:0aa7 class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 1 state: up address: see --recommends
Drives:
  Local Storage: total: 2.73 TiB used: 1.87 TiB (68.5%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Crucial model: CT1000P1SSD8
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
    lanes: 4 type: SSD serial: <filter> rev: P3CR013 temp: 30.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Seagate model: ST2000DM008-2FR102
    size: 1.82 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    type: HDD rpm: 7200 serial: <filter> rev: 0001 temp: 28.0 C
Partition:
  ID-1: / raw-size: 931.01 GiB size: 915.33 GiB (98.32%)
    used: 529.02 GiB (57.8%) fs: ext4 dev: /dev/nvme0n1p3 maj-min: 259:2
  ID-2: /boot/efi raw-size: 512 MiB size: 511 MiB (99.80%)
    used: 6.8 MiB (1.3%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: N/A mobo: N/A
  Fan Speeds (RPM): cpu: 1082 fan-2: 0 fan-3: 1045 fan-4: 1021 fan-5: 0
    fan-6: 0 fan-7: 0 fan-8: 0 fan-9: 0 fan-10: 0
Info:
  Processes: 306 Uptime: 15m wakeups: 0 Memory: 31.27 GiB
  used: 5.11 GiB (16.3%) Init: systemd v: 252 default: graphical
  tool: systemctl Compilers: gcc: 12.2.1 clang: 15.0.7 Packages: pm: pacman
  pkgs: 1914 libs: 492 tools: pamac,yay pm: appimage pkgs: 0 pm: flatpak
  pkgs: 0 Shell: Zsh v: 5.9 default: Bash v: 5.1.16 running-in: konsole
  inxi: 3.3.26

Hello @mrr :wink:

Maybe first check if the problem is really the Wi-Fi. Since you have 2 devices in your local network, maybe try this:

pamac install iperf3
apt install iperf3

Start a server on one computer: iperf3 --server
Run a speed test on the second computer: iperf3 --client 192.xxx.xxx.xxx

That is a raw bandwidth test. Keep sure port 5201 is open on the server.


Also please check the availabe bandwidth:

iw dev <device> link

:notebook: <device> could be wlp2s0. Check ip a.

HI @megavolt

Thanks for your suggestions. I ran both tests but tbh have trouble interpreting the results.

First iperf

PC server / raspberrypi client

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  22.0 MBytes  18.5 Mbits/sec    0             sender
[  5]   0.00-10.44  sec  20.7 MBytes  16.6 Mbits/sec                  receiver

[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.44  sec  20.7 MBytes  16.6 Mbits/sec                  receiver

the other way - PC client / pi server

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  32.0 MBytes  26.9 Mbits/sec    0             sender
[  5]   0.00-10.06  sec  30.1 MBytes  25.1 Mbits/sec                  receiver

[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.06  sec  30.1 MBytes  25.1 Mbits/sec                  receiver

The other command:

iw dev wlan6 link                                                                                                                                                                                                            ✔ 
Connected to ... (on wlan6)
        SSID: ...
        freq: 5240
        RX: 37965263 bytes (34092 packets)
        TX: 37125554 bytes (37913 packets)
        signal: -62 dBm
        rx bitrate: 54.0 MBit/s
        tx bitrate: 54.0 MBit/s

        bss flags:      short-slot-time
        dtim period:    3
        beacon int:     100

Does anything stand out?

@mrr Seems to be pretty normal. It can theoretically use a bandwidth of 54Mbit (~6Mbyte), what is 802.11g. Take into account the correction layer, which reduces the bandwidth anyway. A signal strength of -65dBm is not perfect, but sufficient. So my guess is that Wi-Fi is not the problem here.

Thanks.
Unfortunately right now I don’t have an Ethernet cable long enough to test wired connection. Will have to order it first.

Is there anything else I can check in the meantime?

Just to be sure, post these commands’ result:

$ iw reg get
$ modinfo iwlwifi | grep parm

You know this disables that right? The N band that is.
A more useful option is 11n_disable=8

Do not be confused with the option name, when the value is set to 8 it does not disable anything but re-enables transmission antenna aggregation.

Now the power settings for intel wireless are in a seperate module … depending on the age it is either iwlmvm or for older cards iwldvm.

You can configure the power cheme like so:
/etc/modprobe.d/iwlmvm.conf

options iwlmvm power_scheme=1

Where the schemes are as follows:

1	Always Active
2	Balanced
3	Low-power

Theres also more general power saving;

iw dev wlan0 set power_save off

Oh and depending on your region you may want to look at setting it. More info can be found here:
Network configuration/Wireless - ArchWiki

global
country 00: DFS-UNSET
        (755 - 928 @ 2), (N/A, 20), (N/A), PASSIVE-SCAN
        (2402 - 2472 @ 40), (N/A, 20), (N/A)
        (2457 - 2482 @ 20), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
        (2474 - 2494 @ 20), (N/A, 20), (N/A), NO-OFDM, PASSIVE-SCAN
        (5170 - 5250 @ 80), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
        (5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, AUTO-BW, PASSIVE-SCAN
        (5490 - 5730 @ 160), (N/A, 20), (0 ms), DFS, PASSIVE-SCAN
        (5735 - 5835 @ 80), (N/A, 20), (N/A), PASSIVE-SCAN
        (57240 - 63720 @ 2160), (N/A, 0), (N/A)

phy#0 (self-managed)
country GB: DFS-UNSET
        (2402 - 2437 @ 40), (6, 22), (N/A), AUTO-BW, NO-HT40MINUS, NO-80MHZ, NO-160MHZ
        (2422 - 2462 @ 40), (6, 22), (N/A), AUTO-BW, NO-80MHZ, NO-160MHZ
        (2447 - 2482 @ 40), (6, 22), (N/A), AUTO-BW, NO-HT40PLUS, NO-80MHZ, NO-160MHZ
        (5170 - 5190 @ 80), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, NO-160MHZ, PASSIVE-SCAN
        (5190 - 5210 @ 80), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
        (5210 - 5230 @ 80), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, NO-160MHZ, PASSIVE-SCAN
        (5230 - 5250 @ 80), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
        (5250 - 5270 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, NO-160MHZ, PASSIVE-SCAN
        (5270 - 5290 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
        (5290 - 5310 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, NO-160MHZ, PASSIVE-SCAN
        (5310 - 5330 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
        (5490 - 5510 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, NO-160MHZ, PASSIVE-SCAN
        (5510 - 5530 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
        (5530 - 5550 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, NO-160MHZ, PASSIVE-SCAN
        (5550 - 5570 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
        (5570 - 5590 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, NO-160MHZ, PASSIVE-SCAN
        (5590 - 5610 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
        (5610 - 5630 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, NO-160MHZ, PASSIVE-SCAN
        (5630 - 5650 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
        (5650 - 5670 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, NO-160MHZ, PASSIVE-SCAN
        (5670 - 5690 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
        (5690 - 5710 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, NO-160MHZ, PASSIVE-SCAN
        (5710 - 5730 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
        (5735 - 5755 @ 80), (6, 22), (N/A), AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, NO-160MHZ, PASSIVE-SCAN
        (5755 - 5775 @ 80), (6, 22), (N/A), AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
        (5775 - 5795 @ 80), (6, 22), (N/A), AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, NO-160MHZ, PASSIVE-SCAN
        (5795 - 5815 @ 80), (6, 22), (N/A), AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
        (5815 - 5835 @ 20), (6, 22), (N/A), AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, NO-HT40PLUS, NO-80MHZ, NO-160MHZ, PASSIVE-SCAN

parm:           debug:debug output mask (uint)
parm:           swcrypto:using crypto in software (default 0 [hardware]) (int)
parm:           11n_disable:disable 11n functionality, bitmap: 1: full, 2: disable agg TX, 4: disable agg RX, 8 enable agg TX (uint)
parm:           amsdu_size:amsdu size 0: 12K for multi Rx queue devices, 2K for AX210 devices, 4K for other devices 1:4K 2:8K 3:12K (16K buffers) 4: 2K (default 0) (int)
parm:           fw_restart:restart firmware in case of error (default true) (bool)
parm:           nvm_file:NVM file name (charp)
parm:           uapsd_disable:disable U-APSD functionality bitmap 1: BSS 2: P2P Client (default: 3) (uint)
parm:           enable_ini:0:disable, 1-15:FW_DBG_PRESET Values, 16:enabled without preset value defined,Debug INI TLV FW debug infrastructure (default: 16)
parm:           bt_coex_active:enable wifi/bt co-exist (default: enable) (bool)
parm:           led_mode:0=system default, 1=On(RF On)/Off(RF Off), 2=blinking, 3=Off (default: 0) (int)
parm:           power_save:enable WiFi power management (default: disable) (bool)
parm:           power_level:default power save level (range from 1 - 5, default: 1) (int)
parm:           disable_11ac:Disable VHT capabilities (default: false) (bool)
parm:           remove_when_gone:Remove dev from PCIe bus if it is deemed inaccessible (default: false) (bool)
parm:           disable_11ax:Disable HE capabilities (default: false) (bool)

I did not, to be honest. I was trying various things I found online.

Tried that yesterday, no luck.

Currently my config looks like this

$ cat /etc/modprobe.d/iwlwifi.conf
options iwlwifi 11n_disable=8 swcrypto=0 bt_coex_active=0 power_save=0
options iwlmvm power_scheme=1

I think I have set this in the past. Still tried again, no luck.

Looks odd, the rate is like 20Mhz, probably that AUTO-BW plays. Still, you should get at least 2-2.5 MBps, not 500 kBps. Another iwlwifi magic maybe? This driver has quite some upstream bugs, indeed. May as well change the card to something like QCA9377.

And I’m guessing there’s no alternative driver?

Thanks, I can try this. Any particular cards/vendors? So far I only find laptop adapters with this chipset.

I’m also waiting for Ethernet cable to be delivered to test wired connection as someone has suggested in this thread. Will report once I have the results.

Ok, this is interesting. I’ve tried enabling debug as per Enable full debugging output in the iwlwifi driver - CONFIG_IWLWIFI_DEBUG - - kernelconfig.io

After a restart my wifi got super slow, barely even working, and dmesg printed this every few seconds

[  178.104540] iwlwifi 0000:29:00.0: Queue 11 is active on fifo 1 and stuck for 10000 ms. SW [9, 164] HW [9, 164] FH TRB=0x0c010b018
[  178.105589] iwlwifi 0000:29:00.0: Microcode SW error detected.  Restarting 0x2000000.
[  178.105752] iwlwifi 0000:29:00.0: Start IWL Error Log Dump:
[  178.105753] iwlwifi 0000:29:00.0: Transport status: 0x0000004A, valid: 6
[  178.105755] iwlwifi 0000:29:00.0: Loaded firmware version: 29.198743027.0 3168-29.ucode

Reverting the debug change didn’t help, even after a restart.

I switched from 5GHz to 2.4GHz and suddenly the speed has improved significantly - now I’m getting between 4.5 and 5 MB/s.
Go figure.

As expected wired connection is noticeably faster (I’m getting around 6MB/s).
At the same time my wifi got slower again (about 2.5MB/s) and less stable.
Looks like I’ll be getting a new wireless card soon as I’m done dealing with this iwlwifi rubbish.