In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "Linux server ftp bandwidth restriction". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Limit bandwidth
The ftp server can set the bandwidth of each user so that it can be allocated according to the actual needs and make more full use of the system resources. The bandwidth is set by the parameters "anon_max_rate" and "local_max_rate", which can be appended at the end if they are not found in the configuration file.
1. Set the anonymous user bandwidth, use the parameter "anon_max_rate", and then restart the service.
1) Speed before modification
[root@localhost wj] # lftp 192.168.0.113Viru 8765 / / Anonymous login
Lftp 192.168.0.113 ~ > cd pub/
Lftp 192.168.0.113:/pub > get 1.zip / / download the file
[0] get 1.zip &
`1.zip' at 322830336 (13%) 65.74M/seta:30s [receiving data] / / Speed 65m
2) Open the configuration file "/ etc/vsftpd/vsftpd.conf" and add the word "anon_max_rate=30000" at the end
[root@localhost ~] # gedit / etc/vsftpd/vsftpd.conf
Anon_max_rate=30000 / / the bandwidth of anonymous users is 30kb
3) restart the service to test anonymous user bandwidth
[root@localhost wj] # service vsftpd restart / / restart the service
Close vsftpd: [failed]
Start vsftpd for vsftpd: [OK]
[root@localhost wj] # lftp 192.168.0.113 8765 / / Anonymous login. Note that the port number has been modified before.
Lftp 192.168.0.113 ~ > cd pub/
Lftp 192.168.0.113:/pub > get 1.zip
[0] get 1.zip &
`1.zip' at 1179648 (0%) 28.0K/s eta:22h [receiving data] / / you can see that the download speed here is very slow, only 28k
2. Set the bandwidth of local users through the parameter "local_max_rate". The speed of all local users will be limited here.
1) Open the configuration file "/ etc/vsftpd/vsftpd.conf" and add the word "anon_max_rate=30000" at the end
[root@localhost wj] # lftp david:543092@192.168.0.113:8765 / / user david login, password is 543092
Lftp david@192.168.0.113:~ > ls
-rwxrwxrwx 1 0 2375494044 Aug 14 06:54 1.zip
Lftp david@192.168.0.113:~ > get 1.zip / / download the file
[0] get 1.zip &
`1.zip' at 322830336 (13%) 65.74M/s eta:30s [receiving data] / / Speed 65m
2) Open the configuration file "/ etc/vsftpd/vsftpd.conf" and add the word "local_max_rate=30000" at the end
[root@localhost ~] # gedit / etc/vsftpd/vsftpd.conf
Local_max_rate=30000 / / the bandwidth of local users is 30kb
3) restart the service to test the bandwidth of local users
[root@localhost wj] # service vsftpd restart / / restart the service
Close vsftpd: [failed]
Start vsftpd for vsftpd: [OK]
[root@localhost wj] # lftp david:543092@192.168.0.113:8765 / / user david login, password is 543092
Lftp david@192.168.0.113:~ > ls
-rwxrwxrwx 1 0 2375494044 Aug 14 06:54 1.zip
Lftp david@192.168.0.113:~ > get 1.zip / / download the file
[0] get 1.zip &
`1.zip' at 322830336 (13%) 35.0K/s eta:30s [receiving data] / / Speed 30k
[root@localhost wj] # lftp weijie:123456@192.168.0.113:8765 / / user david login, password is 123456
Lftp david@192.168.0.113:~ > ls
-rwxrwxrwx 1 0 2375494044 Aug 14 06:54 1.zip
Lftp david@192.168.0.113:~ > get 1.zip / / download the file
[0] get 1.zip &
`1.zip' at 322830336 (13%) 29.0K/s eta:30s [receiving data] / / Speed 29k
3. Set the bandwidth of the specified user
1) set the bandwidth configuration directory. The parameter "user_config_dir" can specify a directory to store files for managing bandwidth.
[root@localhost ~] # gedit / etc/vsftpd/vsftpd.conf
User_config_dir=/etc/vsftpd/rate_limit / / A directory that manages user bandwidth. This directory needs to be created by users themselves.
2) set the bandwidth of the user "weijie", create the file "weijie" in the "rate_limit" directory, and add the parameter local_max_rate to the file.
[root@localhost wj] # mkdir / etc/vsftpd/rate_limit
[root@localhost wj] # cd / etc/vsftpd/rate_limit/
[root@localhost rate_limit] # touch weijie
[root@localhost rate_limit] # gedit weijie
Local_max_rate=30000
3) restart the vsftpd service to test the download speed of user "weijie" user "david"
[root@localhost wj] # service vsftpd restart / / restart the service
Close vsftpd: [OK]
Start vsftpd for vsftpd: [OK]
[root@localhost wj] # lftp david:543092@192.168.0.113:8765 / / user david login
Lftp david@192.168.0.113:~ > ls
-rwxrwxrwx 1 0 2375494044 Aug 14 06:54 1.zip
Lftp david@192.168.0.113:~ > get 1.zip
[0] get 1.zip &
`1.zip' at 276234240 (11%) 54.24M/s eta:37s [receiving data] / / Speed 52m
[root@localhost wj] # lftp weijie:123456@192.168.0.113:8765 / / user weijie login
Lftp weijie@192.168.0.113:~ > ls
-rwxrwxrwx 1 0 2375494044 Aug 14 07:13 1.zip
Lftp weijie@192.168.0.113:~ > get 1.zip
[0] get 1.zip &
`1.zip' at 196608 (0%) 21.4K/s eta:30h [receiving data] / / Speed 21k
Lftp weijie@192.168.0.113:~ >
This is the end of the content of "Linux Server ftp limits bandwidth". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.