In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the relevant knowledge of "the method of the connection number limit of nginx speed limit". The editor shows you the operation process through the actual case, the operation method is simple and fast, and the practicality is strong. I hope this article "the method of connection number limit of nginx speed limit" can help you solve the problem.
Scene:
Company a has 100 people, and company a has only one public ip. Suppose company a may have 100 people downloading your website files at the same time.
However, your connection limit is configured as follows:
Limit_conn_zone $binary_remote_addr zone=perip:1m;server {- limit_conn perip 1; limit_rate 1024k; -}
The number of single connections is allowed, and the maximum bandwidth of a single connection is 1m.
In this way, 99 people will have a request status of 503, and others will have to wait manually if they want to download (nginx will not tell users that a has finished downloading, it is your b's turn to download). This results in a very poor user experience. But the advantage is also obvious, the bandwidth will come down soon.
Someone may be about to ask, do you want to cause trouble by limiting the number of connections to a very low number of connections? No, absolutely not. What is the situation of the first 100 people downloading the site's resources at the same time? No statistics have been made, but it is highly unlikely. And the front-end page and download resources do not share the same domain name, so it will not affect the front-end page access.
So who is using the number of connections a lot? There are two categories:
Download the tool class (Thunderbolt).
All kinds of collection procedures.
Perform multiple download tasks at the same time.
Xiaoming was watching TV happily, glanced at the frequency screen on the left, grabbed the grass, and the bandwidth was full again. Come on, speed limit.
Limit_conn_zone $binary_remote_addr zone=perip:1m;server {- limit_rate 1024k; -}
Xiao Ming did the above speed limit, ok, I will tell you who is limited, of course, is the browser download users, 360 browser downloaders may not be able to limit, OK, let's calculate the speed.
Browser: 2014k
Downloader: 1024 * 15 (maximum connections) * vip
Collector: 1024 * number of connections
So we come to the following conclusion:
Limited bandwidth, the same ip downloads at the same time is very small, or predictable business, try to limit the number of connections a little bit.
On the contrary, don't limit it. Reduce the bandwidth of a single connection! You know, who doesn't use the browser to download it with its own downloader?
Note: this paper only discusses the speed limit of nginx speed limit module under different services.
Colored eggs: occasionally found that the number of connections will be limited to 1 Thunderbolt can not be downloaded at high speed.
This is the end of the content about "the method of limiting the number of connections of nginx speed limit". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
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.