It's surprising how many things assume you have available bandwidth

August 17, 2021

For reasons beyond the scope of this entry, I'm currently in a situation where I suddenly care about the amount of bandwidth my various devices are using and want to keep it relatively minimal. This has suddenly made me quite conscious of how common it seems to be for programs and systems to assume that you have plenty of bandwidth and they can use it up at their convenience. As a side effect, it's also made me conscious of how difficult it can be to track how much bandwidth devices are using.

(Some devices support bandwidth accounting in situations where they think they're dealing with limited or expensive data, but in a world of tethering their assumptions are not always accurate. Other things don't even try, leaving it to you to construct ad hoc measures like looking at how much data has flowed through your WireGuard tunnel. I know this is a hard problem, but it can be solved, with systems tracking per-connection bandwidth usage for all connections as some track the bandwidth in selected situations.)

Of course this is a battle that has been fought for a long time in the web world, and many websites are among the bandwidth offenders. But they're not the only ones, and at least you can somewhat choose what you visit with an eye to avoiding places that you know will shovel megabytes of data in your direction at the drop of a hat. But they're not the only problem. Any number of programs and systems will "helpfully" do background updates for you, sometimes transferring substantial amounts of data by constrained data standards. Fortunately some of them either ask first or don't start updates until you tell them to.

(One of the offenders would no doubt tell me that it wasn't actually starting the transfer until I told it to, just checking to see if there were new updates. The problem is that the metadata involved was in the tens of megabytes, perhaps over a hundred MB.)

Another thing this situation has done is recalibrate my views of what is a little bandwidth usage and what is a lot. Suddenly I'm in a situation where I care about even a single megabyte, which is a lot different from usual. Some people would no doubt say that even a few megabytes is not a big deal, and I probably would have too before my views were recalibrated.

Another thing I've suddenly begun thinking about is the potentially dangerous assumptions that devices make about when they should do bandwidth intensive but low priority activities, like making backups or synchronizing photographs. In a world of tethering, the common heuristic of having power and wireless (instead of cellular data) looks less sure than it used to. At least you can defeat that by keeping devices either off the network or unplugged from power.

One of the things I've wished for in this situation is a global control or signal for 'no matter what you think, you're in a data-constrained environment and should throttle yourself'. Even if the bandwidth isn't expensive, it may be limited and I would rather it get used for whatever I have in the foreground instead of background or semi-background activities.


Comments on this page:

I've found NetworkManager's metered connection heuristics to be quite good. Not a fully general solution, since things have to bother to check before using tons of bandwidth, but I've spent 1 year+ on the road with the following in my nightly backup script with no screwups:

#Bail if our default route is metered.  Use 1.1.1.1 since $RHOST may be a tunnel.
IFACE=`ip -o route get 1.1.1.1 | egrep -o ' dev [a-zA-Z]+[0-9]+ ' | awk '{print $2}'`
if nmcli -t -f GENERAL.METERED dev show $IFACE | grep -q '^GENERAL.METERED:yes'; then
    echo "Skipping backup to avoid excessive use of metered connection $IFACE."
    exit 0
fi

I have a fairly limited cellular data plan, so I have a lot of apps simply turned off in the cellular data settings. When I'm headed away from WiFi for a day or more, I try to remember to use the Low Data Mode under Settings > Cellular > Cellular Data Options. I'm not sure how much it affects apps in general, but I will take what I can get.

By Perry Lorier at 2021-08-18 20:09:00:

I'm not sure if it's useful to you, but I wrote up how android tells clients that it's a metered connection: https://www.lorier.net/docs/android-metered.html

Written on 17 August 2021.
« Browsers listening to developers or users requires them to be humble
Configuration (and configuration files) is not and cannot be generic »

Page tools: View Source, View Normal, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Tue Aug 17 18:12:34 2021
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.