Howto shape or restrict bandwidth under Linux / UNIX / BSD

There is a program called trickle. It is a portable lightweight userspace bandwidth shaper. It can run in collaborative mode (together with trickled) or in stand alone mode.

trickle works by taking advantage of the unix loader preloading. Essentially it provides, to the application, a new version of the functionality that is required to send and receive data through sockets. It then limits traffic based on delaying the sending and receiving of data over a socket. trickle runs entirely in userspace and does not require root privileges.

From the article:

Trickle is a lightweight userspace bandwidth shaper for users with low-speed Internet connections that lets you limit the bandwidth that a specific protocol is using so that you can maintain multiple simultaneous connections and not end up in a traffic jam.

Any user on the system can run Trickle without needing administrative privileges. The software can handle only TCP stream connections, so it cannot shape traffic for network services that uses UDP stream connections, such as DNS (Bind) and TFTP. Actually, it cannot work with all network services that use TCP streams; because trickle uses the dynamic linker and loader, it can handle only network services that uses dynamic libraries (glibc) and not any programs that are statically linked. You can check whether a network service or command uses dynamic libraries with help of the ldd command, which prints shared library dependencies, so that you can see exactly what libraries are used with the specific command. For example to check whether FTP uses dynamic libraries:

Read more: Shape your traffic with trickle [Linux.com]

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
2 comments… add one
  • Ultra Aug 17, 2007 @ 2:22

    “Um. wget has a –limit option.”

    If you just use the -limit option with wget, each wget will instance will suck up that much bandwidth. With trickle you can limit the total bandwidth of all the wget’s together…get it?

  • Derek May 10, 2007 @ 19:16

    Um. wget has a –limit option.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.