In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to install and use Trickle in Linux system". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install and use Trickle in the Linux system.
1. Trickle introduction
Trickle is a lightweight user space bandwidth control and management tool used to limit the use of network bandwidth such as browsers such as Firefox, FTP, SSH,curl,wget,scp, etc.
Trickle controls and limits the speed of uploading and downloading applications by controlling the amount of socket data read and written. It is important to note that trickle uses dynamic linking and loading, so it is only useful for programs that use the libc.so library, while others are invalid. Because trickle can set the transmission delay of data on the socket, it can be used to limit the network bandwidth of the application.
Trickle cannot be used to limit the bandwidth of applications that use the UDP protocol, only for TCP connections. Nor does it work on executable programs that use static links.
two。 How to determine that trickle is valid for an application
Based on whether or not to use the libc.so library.
You can use the ldd command to see if an application uses the libc.so library. If your application uses this library, you can use trickle to limit network bandwidth, otherwise you can't.
The code is as follows:
# ldd / usr/bin/wget | grep libc.so
Libc.so.6 = > / lib64/libc.so.6 (0x00002adc30397000)
3. How to install Trickle on Linux
The trickle tool has some dependency packages, and the "libevent library" must be installed before installing and using trickle, but this library is installed by default on most modern Linux machines.
On Debian/Ubuntu/Linux Mint
Run apt-get install trickle on the Debian/Ubuntu/Mint machine to install. Make sure that the source list has been updated, and then install the application you want.
The code is as follows:
$sudo apt-get update
$sudo apt-get install trickle
On RHEL/CentOS/Fedora
First you need to update the system, and then use the following command to install trickle.
The code is as follows:
# yum update
# yum install trickle
How does Trickle work?
Trickle controls and limits the upload / download speed of applications by controlling the amount of socket data read and written. It uses another version of the BSD socket API, but the difference is that trickle also manages socket calls.
It is important to note that trickle uses dynamic linking and loading, so it is only useful for programs that use the Glibc library. Because trickle can set the transmission delay of data on socket, it can be used to limit the network bandwidth of an application.
What can't Trickle do?
Trickle cannot be used to limit the bandwidth of applications that use the UDP protocol, it is only available for TCP connections, but you should know that it is not valid for all TCP connections. If you have been reading this article carefully, you can guess the reason.
Also, trickle does not work on executable programs that use static links.
4. Use trickle
The code is as follows:
# trickle-help
Usage: trickle [- hvVs] [- d] [- u] [- w] [- t]
[- l] [- n] command...
-h Help (this)
-v Increase verbosity level
-V Print trickle version
-s runs independently in stand-alone mode
-d set the maximum cumulative download rate to KB/s
-u set the maximum cumulative upload speed to KB/s
-w sets the window length to KB. Default 512KB.
-t sets the default smoothing time s. Smoothing time determines how many intervals trickle will try to get the application to transfer data. A smaller value (0.1-1 second) results in more continuous (smooth) sessions, which is ideal for interactive applications. Larger values (1-10 seconds) may result in bursts of sending and receiving data, which is better for applications that require a lot of bandwidth.
-l sets the default smoothing length KB. The default is 10 KB.
-n specifies the trickled socket name. Default / tmp/.trickled.sock.
-L sets the delay.
5. Give an example
Limit wget download speed to 50KB/s
6. Limit all command bandwidth of a shell
At this point, I believe you have a deeper understanding of "how to install and use Trickle in the Linux system". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.