Hi, English is not my best language so my apologies for the case.
Two days ago I bought a TP-Link Archer C7 v5 hoping that OpenWrt could help me to control the network with SQM and be able to play video games with little latency and it almost did it, except because I have random ping spikes. It doesn't matter if I am alone or there are 10 people downloading at once, my ping is always low but every 1-5 minutes I have a random ping spike that make the game almost unplayable.
I have 50/10 optical fiber connection with a modem/router Huawei HG8245Q2 installed by my IPS, I have access to it, so I disable all Wi-Fi networks and connect my router TP-Link Archer C7 and opened 3 SSID there, one for 5GHz, one for 2.4GHz and one for guest following this guide: https://openwrt.org/docs/guide-user/network/wifi/guestwifi/guest-wlan-webinterface
When I didn't have the Archer C7 router, the modem my IPS installed worked as a router and I didn't have these random ping spikes when i was alone because the moment someone used the connection, the ping went up.
I already tried turning off the SQM, closing the guest network, changing to simple.qos and nothing works, if I connect the PC via cable Ethernet, the ping spike disappears, but I can't have this PC connected via Ethernet all the time.
I can post more info if needed, I was hopping someone could help me to figure out whats wrong with network.
From your description it looks like you have a problem with the WiFi and not with the SQM (since you don't have problems with the wired connection).
Are you connected to the 5Ghz or 2.4Ghz network? Try to use the 5Ghz if possible.
There are also some optimizations can be done to the WiFi. I'm not using this specific router, but if you search you will find some recommendation for WiFi improvements.
I tried both connections and is exactly the same problem, with the IPS modem/router, both connections worked fine, isn't there any way I can track the issue?
Okay, I would try the following to try to localize the problem a bit better:
disable the two wifi radio's on the router and try playing via a wired connection (disabling the radios will make sure that there should be no interference from wifi at all).
Open a ssh shell to the router and run top -d 1 (note you need to use ctrl-c to end this) to monitor the CPU usage:
Here is the output from my link, during gaming, when the ping spikes occur have a look at the X% idle and the X% sirq fields, if idle dips below 5-10% it would indicate that your router is running out of CPU cycles. (Typically sirq will go up, but the totals load is 100 - X% idle). Please note that traffic shaping does not only need enough CPU cycles in total, but it also needs the quickly enough, so even at a load < 100% sqm might already struggle.
So these SSDs are handled by the OpenWrt device? Anyway, unless the ISP router is in bridge mode you probably deal with double NAT wich is not ideal (but typically tolerable).
That should work ore or less. Could you post the output of tc -s qdisc and cat /etc/config/sqm please?
Oha, there is your problem, wifi, as so often... Really consider running a long cable... I had issues like yours and it turned out it was macos on my laptop insisting upon cyclically scanning all wifi channels and during the scans latency went up, only reliable solution for me was not running a cable (or not caring too much as I do not game, and the latency spikes are rare/short enough to not bother my interactive ssh sessions (using mosh instead of plain ssh helps there as well)).
I read recently (on this forum I think) that the beacon interval better be set to a prime number instead of the default 100ms: 101 or 103 to minimize the chances of overlapping with surrounding APs. Would that help?
this is an interesting idea, but I doubt it will help, there is already a protocol for collision avoidance, and not everyone turns on their router at the same. millisecond
I don't think it would hurt, but your problem is much more likely caused by AP scans like @moeller0 suggested. or other things. your neighbors might do.
Gaming on wifi is just inherently variable. For gaming sessions a wire is far preferred.
With ethernet cable, there are no spikes at all, only with WiFi from the OpenWrt device, also, the spikes not only happens when gamming, if I do for example ping 8.8.8.8 -t i can see the ping spike
Also, I have been cheking %idle and is always at 90 - 98% with or without the ping spikes, %sirq is 0 - 5% also with or without the ping spikes
Yes, all the SSIDs are handled by the OpenWrt device, I am going to investigate about bridge mode to activate it or see if is activated
The thing is, the WiFi work well with my IPS router but doesn't with the OpenWrt device, I really cant run a long ethernet cable, thats why i brought the Archer C7
Where I live there is no neighborhoods
Yes, the two connectios with ping spikes are the 2.4 and 5GHz from the OpenWrt device, if I enable the 2.4 and 5GHz from the IPS modem, the ping spikes are not there
Where I live, there is not neighborhoods, the only Wi-Fi signal in meters is mine.
I will try disabling the continuous scanning and will report back.
Edit: I disable the scanning with netsh wlan set autoconfig enabled=no interface="Wi-Fi" and the spikes are still there
Ping statistics for 8.8.8.8:
Packets: Sent = 246, Received = 246, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 60ms, Maximum = 191ms, Average = 62ms
Great, that indicates it is not a simple overload and also easily avoidable by a cable run (and note ethernet segments with halfway decent cable can be up to 100m in length, maybe allowing to route the cable outside of the house). Except as you say cable is not an option...
Okay, that rules out normal interference by veridical wifi APs and STAs sharing the same or interfering channels, but that still leaves all other sources of signal an noise in the right frequency bands...
That said could you post the output of cat /etc/config/wireless maybe this is related to some configuration, BUT please REACT your WIFI PASSWORDs as these are readable in the config file! (Sorry for shouting, but I want to see no private passwords in the forums ;))
So if you only enable and use 2.4GHz you see the ping spikes as well as when you only enable and use the 5GHz radio?
This is a second sqm that allow me to block the download and upload from the guest network, but already try turning both sqm off and the spikes are still there, the sqm works surprisingly well btw
I was thinking, could the problem be my PC? I dont have a second PC to try until like a week but this problem is really weird maybe my network card is the issue?
I have same problem as OP, I am sitting next to archer C7 V2 running openwrt 19.07.
Running ping myrouteripaddress is reporting average 30ms ping but every 5-10 second ping spike has about 130-200ms, my connection on phone is terrible. Could it be OpenWRT fault ? I havent tried installing stock firmware if that could help...I will report with this later.
If anybody have this kind of problem please report this, all my mobile device are useless now because it affects loading images, files on drive etc, on pc connected with cable its fast as hell.
I think all my problems started from version 18.06.04, I have no balls for downgrading now but if this issue will be confirmed by more people I will test it.
I have the same problem as OP as well.
I am sitting next to an Archer C7 V5 running openwrt 21.02.2
I've had this issue for years across multiple laptops and I can't seem to figure out what in the world is the problem!
I am not using SQM. I feel like there is a certain script kiddie attack that this router is sensitive to, acting like a mini DoS attack that occurs every few minutes.
Even when I'm in the house all by myself with nothing connected except my laptop, it will happen.
I am hundreds of feet from the nearest house, my channels are 100% clean.
It happens on both 2.4 and 5Ghz.
I am going to verify the DoS attack by disconnect the ethernet between the C7 and the internet gateway to see if the issue stops.