Slow and inconsistent WiFi performance (iwlwifi, Intel Wi-Fi 6E AX211, LG gram 2022 16Z90Q-G.AA75Y)

The problem

I’m on 1.2 Gbit connection with a WiFi 6 router, expecting download speeds above 70 MB/s. I can achieve that with Steam temporarily

The speed fluctuates between 10 and 78 MB/s, but is overall acceptable. However, when I try to download via the terminal, like pip here for example, the speed will peak at approx 35 MB/s for a short time, and then drop to 1 MB/s or below and not raise back up.

This makes downloading via the terminal extremely slow. Every package starts off with 20-30 MB/s but then drops and remains at the slow speed until the download finishes. What you see above is that 200 MBs were downloaded very quickly and the reminder of the download speed remains low. The time at which the dl speed is high varies. The behavior persists through reboot, system upgrade, router reboot.

Edit: larger packages via pacman or the AUR show the same behavior.

Diagnostics

System info

[voii@vogram ~]$ neofetch
                     ./o.                  voii@vogram 
                   ./sssso-                ----------- 
                 `:osssssss+-              OS: EndeavourOS Linux x86_64 
               `:+sssssssssso/.            Host: 16Z90Q-G.AA75Y 0.1 
             `-/ossssssssssssso/.          Kernel: 6.4.9-arch1-1 
           `-/+sssssssssssssssso+:`        Uptime: 42 mins 
         `-:/+sssssssssssssssssso+/.       Packages: 1475 (pacman) 
       `.://osssssssssssssssssssso++-      Shell: bash 5.1.16 
      .://+ssssssssssssssssssssssso++:     Resolution: 2560x1600 
    .:///ossssssssssssssssssssssssso++:    DE: Plasma 5.27.7 
  `:////ssssssssssssssssssssssssssso+++.   WM: KWin 
`-////+ssssssssssssssssssssssssssso++++-   Theme: [Plasma], Breeze [GTK2/3] 
 `..-+oosssssssssssssssssssssssso+++++/`   Icons: Qogir-dark [Plasma], Qogir-dark [GTK2/3] 
   ./++++++++++++++++++++++++++++++/:.     Terminal: konsole 
  `:::::::::::::::::::::::::------``       Terminal Font: Source Code Pro Light 10 
                                           CPU: 12th Gen Intel i7-1260P (16) @ 4.700GHz 
                                           GPU: Intel Alder Lake-P 
                                           Memory: 5336MiB / 15711MiB 

WiFi hardware

[voii@vogram ~]$ lspci -k
00:14.3 Network controller: Intel Corporation Alder Lake-P PCH CNVi WiFi (rev 01)
        Subsystem: Intel Corporation Wi-Fi 6E AX211 160MHz
        Kernel driver in use: iwlwifi
        Kernel modules: iwlwifi

Power

All tests were done on battery, using balanced power settings in KDE’s powerdevil GUI, as it is my main use case.

Diagnosing fluctuations

What I saw with steam was likely caused by thermal throttling of the WiFi chip, below you see KDE’s System Monitor output during the download I showed above.

Not great, but this seems like an acceptable behavior when the fans are not running full-out.

Speedtest results

This is where things get interesting. Running speedtest in Chromium yields

But running via speedtest-cli on the same server immediately before/after the chromium run yields much lower results

[voii@vogram ~]$ speedtest-cli --server 37720
Retrieving speedtest.net configuration...
Testing from Vectra Broadband (xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by MTnet (Debica) [xxx km]: 45.174 ms
Testing download speed................................................................................
Download: 44.89 Mbit/s
Testing upload speed......................................................................................................
Upload: 36.46 Mbit/s
[voii@vogram ~]$ speedtest-cli --server 37720
Retrieving speedtest.net configuration...
Testing from Vectra Broadband (xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by MTnet (Debica) [xxx km]: 1200013.364 ms
Testing download speed................................................................................
Download: 26.50 Mbit/s
Testing upload speed......................................................................................................
Upload: 73.84 Mbit/s

This is confirmed by System Monitor (Chromium first, CLI second)

iwconfig output

[voii@vogram ~]$ iwconfig wlan0
wlan0     IEEE 802.11  ESSID:"Vectra-XXX"  
          Mode:Managed  Frequency:5.22 GHz  Access Point: XXX
          Bit Rate=-1.89307e+06 kb/s   Tx-Power=20 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=63/70  Signal level=-47 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:76   Missed beacon:0

dmesg output

[voii@vogram ~]$ sudo dmesg|grep iwlwifi
[    3.103660] iwlwifi 0000:00:14.3: enabling device (0000 -> 0002)
[    3.108665] iwlwifi 0000:00:14.3: Detected crf-id 0x400410, cnv-id 0x80400 wfpm id 0x80000020
[    3.108719] iwlwifi 0000:00:14.3: PCI dev 51f0/0094, rev=0x370, rfid=0x2010d000
[    3.120033] iwlwifi 0000:00:14.3: api flags index 2 larger than supported by driver
[    3.120057] iwlwifi 0000:00:14.3: TLV_FW_FSEQ_VERSION: FSEQ Version: 0.0.2.39
[    3.120498] iwlwifi 0000:00:14.3: loaded firmware version 78.3bfdc55f.0 so-a0-gf-a0-78.ucode op_mode iwlmvm
[    3.453163] iwlwifi 0000:00:14.3: Detected Intel(R) Wi-Fi 6E AX211 160MHz, REV=0x370
[    3.462141] iwlwifi 0000:00:14.3: WRT: Invalid buffer destination
[    3.619535] iwlwifi 0000:00:14.3: WFPM_UMAC_PD_NOTIFICATION: 0x1f
[    3.619600] iwlwifi 0000:00:14.3: WFPM_LMAC2_PD_NOTIFICATION: 0x1f
[    3.619608] iwlwifi 0000:00:14.3: WFPM_AUTH_KEY_0: 0x80
[    3.619616] iwlwifi 0000:00:14.3: CNVI_SCU_SEQ_DATA_DW9: 0x0
[    3.620367] iwlwifi 0000:00:14.3: loaded PNVM version 181407b3
[    3.620871] iwlwifi 0000:00:14.3: RFIm is deactivated, reason = 4
[    3.636079] iwlwifi 0000:00:14.3: Detected RF GF, rfid=0x2010d000
[    3.706804] iwlwifi 0000:00:14.3: base HW address: 8c:17:59:29:9d:11
[    4.056018] iwlwifi 0000:00:14.3: WRT: Invalid buffer destination
[    4.208045] iwlwifi 0000:00:14.3: WFPM_UMAC_PD_NOTIFICATION: 0x1f
[    4.208155] iwlwifi 0000:00:14.3: WFPM_LMAC2_PD_NOTIFICATION: 0x1f
[    4.208162] iwlwifi 0000:00:14.3: WFPM_AUTH_KEY_0: 0x80
[    4.208169] iwlwifi 0000:00:14.3: CNVI_SCU_SEQ_DATA_DW9: 0x0
[    4.224212] iwlwifi 0000:00:14.3: RFIm is deactivated, reason = 4
[    4.303787] iwlwifi 0000:00:14.3: Registered PHC clock: iwlwifi-PTP, with index: 0
[    4.361661] iwlwifi 0000:00:14.3: WRT: Invalid buffer destination
[    4.513710] iwlwifi 0000:00:14.3: WFPM_UMAC_PD_NOTIFICATION: 0x1f
[    4.513720] iwlwifi 0000:00:14.3: WFPM_LMAC2_PD_NOTIFICATION: 0x1f
[    4.513728] iwlwifi 0000:00:14.3: WFPM_AUTH_KEY_0: 0x80
[    4.513736] iwlwifi 0000:00:14.3: CNVI_SCU_SEQ_DATA_DW9: 0x0
[    4.530041] iwlwifi 0000:00:14.3: RFIm is deactivated, reason = 4
[    8.170327] iwlwifi 0000:00:14.3: Unhandled alg: 0x707
[    8.170546] iwlwifi 0000:00:14.3: Unhandled alg: 0x707
[    8.170761] iwlwifi 0000:00:14.3: Unhandled alg: 0x707
[    8.171010] iwlwifi 0000:00:14.3: Unhandled alg: 0x707
[    8.171276] iwlwifi 0000:00:14.3: Unhandled alg: 0x707
[    8.171550] iwlwifi 0000:00:14.3: Unhandled alg: 0x707
[    8.171757] iwlwifi 0000:00:14.3: Unhandled alg: 0x707
[    8.172069] iwlwifi 0000:00:14.3: Unhandled alg: 0x707

sysctl output

[voii@vogram ~]$ sysctl -a |& grep ipv4.tcp
net.ipv4.tcp_abort_on_overflow = 0
net.ipv4.tcp_adv_win_scale = 1
net.ipv4.tcp_allowed_congestion_control = reno cubic
net.ipv4.tcp_app_win = 31
net.ipv4.tcp_autocorking = 1
net.ipv4.tcp_available_congestion_control = reno cubic
net.ipv4.tcp_available_ulp = espintcp mptcp
net.ipv4.tcp_base_mss = 1024
net.ipv4.tcp_challenge_ack_limit = 2147483647
net.ipv4.tcp_child_ehash_entries = 0
net.ipv4.tcp_comp_sack_delay_ns = 1000000
net.ipv4.tcp_comp_sack_nr = 44
net.ipv4.tcp_comp_sack_slack_ns = 100000
net.ipv4.tcp_congestion_control = cubic
net.ipv4.tcp_dsack = 1
net.ipv4.tcp_early_demux = 1
net.ipv4.tcp_early_retrans = 3
net.ipv4.tcp_ecn = 2
net.ipv4.tcp_ecn_fallback = 1
net.ipv4.tcp_ehash_entries = 131072
net.ipv4.tcp_fack = 0
net.ipv4.tcp_fastopen = 1
net.ipv4.tcp_fastopen_blackhole_timeout_sec = 0
sysctl: permission denied on key 'net.ipv4.tcp_fastopen_key'
net.ipv4.tcp_fin_timeout = 60
net.ipv4.tcp_frto = 2
net.ipv4.tcp_fwmark_accept = 0
net.ipv4.tcp_invalid_ratelimit = 500
net.ipv4.tcp_keepalive_intvl = 75
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_keepalive_time = 7200
net.ipv4.tcp_l3mdev_accept = 0
net.ipv4.tcp_limit_output_bytes = 1048576
net.ipv4.tcp_low_latency = 0
net.ipv4.tcp_max_orphans = 65536
net.ipv4.tcp_max_reordering = 300
net.ipv4.tcp_max_syn_backlog = 1024
net.ipv4.tcp_max_tw_buckets = 65536
net.ipv4.tcp_mem = 186972       249299  373944
net.ipv4.tcp_migrate_req = 0
net.ipv4.tcp_min_rtt_wlen = 300
net.ipv4.tcp_min_snd_mss = 48
net.ipv4.tcp_min_tso_segs = 2
net.ipv4.tcp_moderate_rcvbuf = 1
net.ipv4.tcp_mtu_probe_floor = 48
net.ipv4.tcp_mtu_probing = 0
net.ipv4.tcp_no_metrics_save = 0
net.ipv4.tcp_no_ssthresh_metrics_save = 1
net.ipv4.tcp_notsent_lowat = 4294967295
net.ipv4.tcp_orphan_retries = 0
net.ipv4.tcp_pacing_ca_ratio = 120
net.ipv4.tcp_pacing_ss_ratio = 200
net.ipv4.tcp_plb_cong_thresh = 128
net.ipv4.tcp_plb_enabled = 0
net.ipv4.tcp_plb_idle_rehash_rounds = 3
net.ipv4.tcp_plb_rehash_rounds = 12
net.ipv4.tcp_plb_suspend_rto_sec = 60
net.ipv4.tcp_probe_interval = 600
net.ipv4.tcp_probe_threshold = 8
net.ipv4.tcp_recovery = 1
net.ipv4.tcp_reflect_tos = 0
net.ipv4.tcp_reordering = 3
net.ipv4.tcp_retrans_collapse = 1
net.ipv4.tcp_retries1 = 3
net.ipv4.tcp_retries2 = 15
net.ipv4.tcp_rfc1337 = 0
net.ipv4.tcp_rmem = 4096        131072  6291456
net.ipv4.tcp_sack = 1
net.ipv4.tcp_slow_start_after_idle = 1
net.ipv4.tcp_stdurg = 0
net.ipv4.tcp_syn_retries = 6
net.ipv4.tcp_synack_retries = 5
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_thin_linear_timeouts = 0
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_tso_rtt_log = 9
net.ipv4.tcp_tso_win_divisor = 3
net.ipv4.tcp_tw_reuse = 2
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_wmem = 4096        16384   4194304
net.ipv4.tcp_workaround_signed_windows = 0

Attempts at fixing

I experimented a bit with iwlwifi settings as suggested here on Archwiki.

to /etc/modprobe.d/iwlwifi.conf I added

options iwlwifi 11n_disable=1 swcrypto=1

but all it did was to limit my overall bandwidth to 20 Mbits, so I reversed the changes.

Googling around for errors from dmesg|grep iwlwifi didn’t yield anything that would apply to this particular problem and driver.

I would really appreciate your help :wink:

This is from speedtest-cli’s github page.

Have you tried updating your mirrors?

This could be caused by slow mirrors. It’s interesting that you mentioned every package. Does the reported download speed refer to the overall download speed of all packages currently being installed or the download speed of each individual package. Because if there are dependencies, pacman will download more than one package concurrently.

What if you were to try to download a file with your browser and then with wget to compare the speeds?

1 Like

I see, then I’m not taking speedtest into account.

Yes, I do that regularly. I tried to reproduce the behavior from yesterday using when using paru, but I couldn’t. Before or after an update, package downloading is fine.

I did just that with the SDXL checkpoints from HuggingFace.

In the browser I had an average speed of 27-30 MB/s, with graphs like these

Using wget on the same file I had an average speed of 69 MB/s

sd_xl_base_1.0.sa 100%[===========>]   6.46G  69.6MB/s 

and it produced graphs like this


Using git clone on the repo produces the same results.

Using KGet works the best.

I did the same with torch from PyPI and here the behavior is different, in all cases PyPI is limiting the DL speed shortly after the DL begins. The same results for Chromium, wget, pip.

Now, that I can’t reproduce the problem with paru I’m leaning towards this explanation. It seems like PyPI is just slow for me (for whatever reason).

The speed inconsistencies remain. Perhaps this has to do with KDE power settings? KGet seems to obey by different rules, it can heat up the WiFi sensor beyond 43 C.