Limit the download speed from within the OS?

Hi, guys. I’m wondering if there’s any way to limit the download speed from within Arch? I have made settings for that in the router CP but they don’t seem to work bc Arch is completely ignoring them and keeps downloading with the full bandwidth it can get.

The thing is that our IPTV is from another provider which is why I need to leave some bandwidth for the TV. When I’m downloading something directly (meaning from FTP or TCP), even if it’s just for a fraction of the second, the TV dies instantly. That’s why I need to limit the download speed somehow - preferably from within Arch.

blue_penquin
link
4
edit-2
4M

There is Trickle https://wiki.archlinux.org/title/Trickle and Wondershaper https://github.com/magnific0/wondershaper#using-wondershaper

curl/wget both have a --limit-rate option

There is tc and iptables that can both do latecy and bandwidth quotas.

@Valso
creator
link
1
edit-2
4M

Thanks. :) Seeing that there are two votes here for wondershaper, I decided to try that one first. I did read the instruction in github but since I’ve never used it before, I can’t be sure if what I did was right. I wanted it to remember the setting permanently, so I figured it would be best to save the setting in its empty wondershaper.conf file (in /etc/systemd). At the moment there are no new updates available, so I’ll have to wait until a new update arrives in order to test it. Or, if I’m not bothering you, you can tell me if this content of /etc/systemd/wondershaper.conf is sufficient to work: -a enp0s25 -d 31000 -u 31000

My LAN card’s name is enp0s25.

Edit: apparently I’m not doing it right. I found a way to test it with one of my large files on Google Drive (after reboot) and despite my setting of 31000 KB/sec., it still downloads at a higher rate than that - 33000+ KiB. According to Digital Storage, 31000 KB/sec = 30273.44 KiB. That means I’m doing it wrong.

Arch_guy
link
1
edit-2
4M

+1 for wondershaper(available in AUR) it will limit speed of network adapter , and easy to use.

@fruechtchen
link
24M

not sure if helpful but one technical term which could be useful to understand things is “traffic shaping”: https://en.wikipedia.org/wiki/Traffic_shaping

reducing the bandwidth of some programs is part of that.

see also https://wiki.archlinux.org/title/Shorewall and https://wiki.archlinux.org/title/Advanced_traffic_control

“linux traffic shaping” seems to be an interesting internet search term.

@Valso
creator
link
14M

I’ve limited the down/up speed in the programs that have this feature. But the internet browsers don’t have it and it’s their speed I’m trying to limit.

@fruechtchen
link
14M

yes. and traffic shaping is (as far as i understand) on the level of the operating system or the kernel which controls the network usage of programs.

usually a bit more complicated but it could work. so the browsers, for instance your internet browser tries to go full speed but the kernel/operating system says: “full speed means for you 500kb/s” or something.

@fruechtchen
link
2
edit-2
4M

so basically what i am saying here is the same as @blue_penquin@lemmy.ml in their post just using different words. My intention was to add some background to it.

The beloved lightweight distro

  • 0 users online
  • 1 user / day
  • 1 user / week
  • 4 users / month
  • 33 users / 6 months
  • 898 subscribers
  • 48 Posts
  • 68 Comments
  • Modlog