ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Geo проблема


  • To: nginx-ru@xxxxxxxxx
  • Subject: Geo проблема
  • From: Konstantin Svist <fry.kun@xxxxxxxxx>
  • Date: Tue, 23 Aug 2011 18:36:44 -0700
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=NSm0Y/61t/enLsf5UlY6a+h1kCBckCHjYxdxnFCtpMc=; b=GQ7NVPIZMTLJKpNc3qKLtlvW4VIP2bME3H5kVsqVDAinOwObzfbJq4jEa9ktSgRgNO BIWWlBC5BjP4MlwP8JATw6r2QPOVZT0HxJUPhFxQwWUQzVrtpz0o0vOjr+k06YJeesSK uH7f5v0IeHfFjYgNrf5ciGjNyGLIfeOGLlVvw=

У меня почему-то Geo ест слишком много памяти.

Без Geo (top):

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
6324 nobody 20 0 287m 52m 2052 S 0.0 0.2 0:00.03 nginx: worker process 6304 root 20 0 284m 47m 524 S 0.0 0.1 0:00.02 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

Когда добавляю Geo:

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
8151 nobody 20 0 668m 437m 6036 S 25.6 1.4 0:27.91 nginx: worker process 8113 root 20 0 664m 427m 572 S 0.0 1.3 0:00.28 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

А если сделать kill -HUP, то ещё хуже:

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
28811 nobody 20 0 1213m 984m 8188 S 23.7 3.0 2109:47 nginx: worker process 2721 root 20 0 1213m 978m 2548 S 0.0 3.0 0:37.95 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf



nginx.conf:

http {
    geo  $ip_blocklist_in  $ip_blocklist_out  {
        default  "OK";
        include  ipblocklist.conf;
    }
    proxy_set_header  Custom-Ip-Blocklist          $ip_blocklist_out;
    fastcgi_param     HTTP_CUSTOM_IP_BLOCKLIST     $ip_blocklist_out;
    ...
    server {    # большинство таких (~20) - не пользую Geo
        ...
    }
    server {    # 2 таких - не пользую Geo
        set  $ip_blocklist_in '';
        ...
    }
    server {    # 1 такой - пользую Geo
        location /xyz {
set $ip_blocklist_in $arg_i; # client passes IP as url param
            ...
        }
        ...
    }
    server {    # 4 таких - пользую Geo
        set  $ip_blocklist_in   $arg_i; # client passes IP as url param
        ...
    }
}


ipblocklist.conf:

10.10.10.111    ab|bc;
10.10.10.189    ab|bc;
10.10.252.101   bc|defg;
10.100.10.100   ab|bc|defg;
...

~670,000 линий, всего 13M на диске.


_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.