Networking – Limiting Specific Shell’s Internet Bandwidth Usage

bandwidthlimitnetworkingprocess

I want update my linux in one shell but by default wget or axel in updater use all the bandwidth.

How can I limit the speed in this shell?

I want other shells to have a fair share, and to limit everything in that shell – something like a proxy!

I use Zsh and Arch Linux.

This question focuses on process-wide or session-wide solutions. See How to limit network bandwidth? for system-wide or container-wide solutions on Linux.

Best Answer

Have a look at trickle a userspace bandwidth shaper. Just start your shell with trickle and specify the speed, e.g.:

trickle -d 100 zsh

which tries to limit the download speed to 100KB/s for all programs launched inside this shell.

As trickle uses LD_PRELOAD this won't work with static linked programs but this isn't a problem for most programs.