
原帖由 gdtv 于 2009-11-14 13:08 发表
我靠,天下文章一大抄害死人
limit_rate不能限制目录的速度,只能限制整个网站的速度,所以放在location /attachments/ {}里面是不起作用的。
原帖由 cpuer 于 2009-11-14 13:01 发表
Limit_rate
语法:limit_rate speed
默认值:no
Context:http,server,location
用来限制服务器对客户的应答传输速率,速率是B/S,此限制仅对一个连接有效,如果客户发起两个连接,速率将会是高于限制的两倍。
服务器级别上限 ...
原帖由 cpuer 于 2009-11-14 13:01 发表
Limit_rate
语法:limit_rate speed
默认值:no
Context:http,server,location
用来限制服务器对客户的应答传输速率,速率是B/S,此限制仅对一个连接有效,如果客户发起两个连接,速率将会是高于限制的两倍。
服务器级别上限 ...
原帖由 gdtv 于 2009-11-14 13:14 发表
limit_conn one 1; 这个很不好用,多于一个连接,不是等待、然后依次连接,而是直接Kill掉。
所以如果一个页面有多个图片,只能显示一个了
原帖由 zyypp 于 2009-11-14 14:33 发表
ngx_http_limit_zone_module
这个模块是限制并发连接数的
不能真正的起到限速的作用 只是变相的 限制连接数从而减少带宽 或者采集
原帖由 zyypp 于 2009-11-14 14:33 发表
ngx_http_limit_zone_module
这个模块是限制并发连接数的
不能真正的起到限速的作用 只是变相的 限制连接数从而减少带宽 或者采集

原帖由 gdtv 于 2009-11-14 14:51 发表
现在还没解决
1、如果用limit_conn,那么多余的图片会显示X,而不是排列等待下载
2、如果用limit_rate,那么空闲的时候limit_rate不能自动调整,浪费
现在只有寄望于if($slow){set $limit_rate 4k;},可是不知这个怎么弄。...
limit_rate
syntax: limit_rate speed
default: no
context: http, server, location, if in location
Directive assigns the speed of transmission of the answer to client. Speed is assigned in the bytes per second. Limitation works only for one connection, i.e., if client opens 2 connections, then total velocity will be 2 times higher then the limit set.
If it is necessary to limit speed for the part of the clients at the server level, based on some kind of condition - then this directive does not apply. Instead you should specify the limit by assigning the value to the $limit_rate variable, as shown below:limit_rate_after复制代码
- server {
- if ($slow) {
- set $limit_rate 4k;
- }
- }
syntax: limit_rate_after time
default: limit_rate_after 1m
context: http, server, location, if in location
The directive limits speed only after the first part was sent.复制代码
- limit_rate_after 1m;
- limit_rate 100k;
server {
if ($slow) {
set $limit_rate 4k;
}
}
| 欢迎光临 全球主机交流论坛 (https://www.iloc.eu.org/) | Powered by Discuz! X3.4 |