Осторожно: limit_rate & proxy_pass

Igor Sysoev is at rambler-co.ru
Mon Feb 14 17:45:25 MSK 2005


On Mon, 14 Feb 2005, Leonid Novikov wrote:

> IS> > location / {
> IS> > root /bla-bla/;
> IS> > }
> IS> > location /2004/ {
> IS> > proxy_pass http://x.x.x.x/;
> IS> > }
> IS>
> IS> Да, limit_rate работает только для статики.
> IS> Будет работать для всего.
>
> Но не работает:(
> Нашел время оттестировать с нуля и нижеописанная конфигурация
> гарантированно приводит к пожиранию nginx'ом всего доступного
> процессорного времени, файлы не отдаются вообще.
> --------------------------------------------------
> user apache apache;
> worker_processes  5;
> pid /var/run/nginx.pid;
> error_log  /var/log/nginx/error.log;
>
> events {
>    connections   200;
>    use epoll;
> }
>
> http {
>    include /etc/nginx/mime.types;
>    limit_rate 3M;
>
> server {
> listen        x.x.x.x:80;
> server_name   xxx.xxx.ru;
> access_log   /var/log/nginx/access.log;
>
> location /2004/ {
> proxy_pass http://192.168.1.10/;
> }
>
> location / {
> root /var/www/html/;
> autoindex on;
> }
>
> }
> }
> -------------------------------------------------
> Версия - 0.1.18
> Сборка практически по умолчанию:
> ./configure \
>    --prefix=/etc/nginx \
>    --sbin-path=/usr/sbin \
>    --user=apache \
>    --group=apache \
>    --conf-path=nginx.conf \
>    --pid-path=/var/run/nginx.pid \
>    --error-log-path=/var/log/nginx_error.log \
>    --http-log-path=/var/log/nginx_access.log \
>    --http-client-body-temp-path=/var/lib/nginx/tmp \
>    --http-proxy-temp-path=/var/lib/nginx/proxy \
>    --http-fastcgi-temp-path=/var/lib/nginx/fcgi \
>    --with-http_stub_status_module \
>    --with-cc-opt="" --with-debug
>
> Linux 2.6.10-1.741_FC3
> gcc (GCC) 3.4.3 20050124 (Red Hat 3.4.3-17)
>
> При установке логлевела в debug генерится 150 метров за один запрос:
> wget -S -T 20 http://x.x.x.x/2004/issue_20041225.avi

Насколько я понимаю, запрос

wget -S -T 20 http://x.x.x.x/2004/issue_20041225.avi

это не статичский запрос. А проксированный:

     location /2004/ {
         proxy_pass http://192.168.1.10/;
         ....

Соотвественно, limit_rate работать не будет.


Игорь Сысоев
http://sysoev.ru





More information about the nginx-ru mailing list