Is there any way to reduce wwan gw latency under load

With a LTE gateway, regardless of what bandwidth is available at any given time, latency spikes terribly whenever someone downloads or uploads something (I'm not sure which). I found one suggestion to use SQM and set the limits to the daily minimum, which would of course limit bandwidth to the minimum full-time. It seems like a very sub-optimal solution. Is there some other option? At least it seems to me that manufacturers should have thought of this since there are billions of wwan connections.

Not exactly, you set the limit to something like 90% of the available bandwidth to avoid congestion on your side, which would cause spikes.

But the available bandwidth seems to fluctuate by the minute. Something between 2Mbps and 30Mbps. If I set it at 27Mbps it won't have the desired effect if the bandwidth is anything below that. And if I set it to 1.8Mbps then bandwidth will always be limited to 1.8. Is that correct?

Well, if you don't have at least a stable bandwidth, how can any solution work for you? QoS should at least know what is the amount of bandwidth it has available to prioritize the packets waiting to be transmitted.

I find it hard to believe that there's no possible technical solution for variable bandwidth. Can I for example optimize some parameter in SQM like queue length to trade off speed for latency?

First you need to understand that SQM or any QoS cannot work miracles on an unstable connection.
Second, no matter how much you expand the queue length, the result is the same. Packets will be sitting and waiting in the queue instead of being discarded, which will be depicted as a spike on the application.

problem isn't that it's variable, problem is you don't know the capacity, any given second.

If you could poll the modem, and have it report the signal strength/quality, perhaps you could be able to derive the approx speed available.
Based on that info, set up an algorithm for throttling the clients.

1 Like

Ok, I appreciate your answers and accept that there's currently no solution.

Still looking at the problem upside down, is it possible to maximize latency (without artificially adding traffic)? If it is, then the opposite solution should likely reduce latency. Of course that 'solution' is likely already in place.

I did some tests with SQM, and it really does help when configured to moderate speeds - a little below what can be reasonably achieved during rush hour. SQM brought latencies down quite a bit, and most importantly the 90pct latency came down by 80-90% compared to no SQM. So it is a tradeoff between latency (median, avg, and 90pct) and bandwidth. The lower the speed (configured), the rarer latency spikes become, but it seems almost impossible to get rid of them with the help of SQM. In general though, SQM really does help.

Sure there is: Reduce the buffering in the wwan gw.

Nice! How can I do that?

Had to reread the thread, but still couldn't figure out what wwan gw you have. But the generic adice is: Ask your wwan gw vendor.

If that is OpenWrt, then we'd have to know a few more details about your hardware and driver choices

OpenWRT on Raspberry Pi 3 B+ and a Huawei USB LTE dongle using QMI. No Wifi in use.

Nothing much to do then, unfortunately. There is no buffering in qmi_wwan unless you are using QMAP. So that means the bloated buffers most likely are on the operator side of that link.

1 Like

Ok, I get it. Thanks anyway!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.