Is there a way to limit upload speed on docker (debain)?

Hello,

I’m facing a little issue with my storage node. It’s filling up very well, which is nice, but now my node starts to use all of my upload speed several times a day. Every now and the xit uses all of the upstream for some minutes, at this time I’m literally “offline”. Is there a way to limit the upload speed? My internet connection is able to handle 50 MBit upstream, so I would give storage around 40 mbit, so I have 10 mbit left for me, since I personally do not need that much. I know that there is an option in the yaml file for overall traffic per month, but I don’t think this will solve the isse. I want to even the peaks a bit. I’m running my storage node via docker on my debain system. Thank you very much.

1 Like

one node? i have 2 and no problems with my 40mbit upload, and im confident to use them on 10mbit upload soon. (gaming and streaming without problems)

how is the node connected?

That would be solving the wrong problem. Unused bandwidth is wasted bandwidth, you are paying for resources you can’t use. Limiting bandwidth is counterproductive and will be somewhat helping as a side effect.

You shall be able to saturate upstream all the time and still have low latency for all other applications.

Since this is evidently not the case for you — your network likely suffers from bufferbloat: https://www.bufferbloat.net

Run this to confirm (ideally, using wired connection, not wireless, otherwise you might be conflating wifi specific issues): https://www.waveform.com/tools/bufferbloat

Once confirmed, enable SQM on your router (it goes by a variety of marketing names) to completely fix this and related issues once and for all. In fact, your browsing experience will likely improve too.

If your router does not support SQM — defenestrate it, and get one that does.

2 Likes

Yes, it’s one node, it’s not the whole day, where it uploads at whole bandwidth, it’s just several minutes over the day. At this time my ip TV and other networking devices are snot working. It’s not everyday, it’s the second day this happens this month. Some days I have more than 200gb upstream, most days are around 50gb per day.

I looked on the internet regarding bufferbload on my router. It seem to be a known issue. Unfortunately I am not able to change the router, so I think at the moment a network limitation on the upload will be the only solution. When checking the daily upload of my node, I’m averageing at around 10 mbit upstream per day, so when limiting the upload to around 40 mbit to even out the peaks, it won’t be that bad for the storj network, because it’s just several times per month.

Why can’t you change the router? Is it ISP gateway/modem combo? You should be able to put it to bridge mode and install your own router behind.

This does not just affect/manifests with storagenode. It affects everything on your network, including voip and videoconferencing, gaming, and browsing. You think your internet behaves “normal” but you’ll be blown away by how actually can it behave when network equipment does not hoard packets.

If you want to go QoS route (which I absolutely recommend against) — the QoS settings on the router shall let you do that on per IP basis.

I’m owning a fritzbox which I bought some years ago, because of it’s smart home and some other features. And yes it’s a router modem combo. They build good routers, but unfortunately they are not as manageable as an openwrt router. They are more likely fore the “normal” people, even though the “expert mode” gives lots of options. So for now, the quick and dirty way will be QoS, unfortunately. Is there a way to do this in docker, or do I need a managed switch for that?

You can install OpenWRT on some Fritz boxes. I would still consider replacing it with some better network hardware. Like Ubiquiti.

That said, after a brief consult with Google Bard, evidently QoS on Fritz box is called “prioritization” and is located in Internet → Filters → prioritization. I assume you can de-prioritize traffic from storagenode IP or prioritze traffic from all other IPs.

If you want to rate limit on a container level you probably may use something like GitHub - lukaszlach/docker-tc: 🐳 Docker Traffic Control - network rate limiting, emulating delays, losses, duplicates, corrupts and reorders of network packets using only container labels or a command-line interface.. But router is the right place to manage traffic.

2 Likes

so basically this is some kind of QoS that actually works?

Thank you. For the priority settings, there are only 3 modes: disabled, normal and priorized. I set my iptv etc to high priority and my node to normal. I had my node set to high priority back then , maybe that’s why it caused the whole network to be “offline” when it used all of the egress/upload. I hope that will fix it.

2 Likes

I’m with the other posters: you fix this by limiting the upload speed at your router. If you use pfsense check here.

Yep. It magical. Seriously. Unlike traditional QoS where you have to tweak and struggle all the time and still end up wasting tons of resources even when everything works, codel algorithms allows you to take full advantage of your channel.

More here CoDel - Wikipedia

2 Likes

Or you can set every other IP in your lan, except storage node, to high priority.

I’m not sure it will help though. In case of congestion high priority packets will get stuck behind low priority ones anyway.

The IPTV dosen’t have dedicated bandwidth from ISP? I remember asking this to my ISP a few years back, but I can’t remember the answear.

depends on the streaming protocol.

In my case not. Because I’m using a different service, not the one offered by my ISP.

:joy:
Defenestration (from Neo-Latin de fenestrā[1]) is the act of throwing someone or something out of a window.[2] The term was coined around the time of an incident in Prague Castle in the year 1618

3 Likes

Oh yes, it’s one of my favourite words. I was waiting for an opportunity to use it for a very long time!

3 Likes