Server
Nginx (0.3.58) <-> Server Apache
ÚÁÇÒÕÚËÁ ÎÁ apache: 0.70 -š 0.80
ÎÁ nginx server ÚÁÇÒÕÚËÁ 0.50 - 0.60
ÎÁ servers - RHEL 4.0: 2.6.9-34.ELsmp, Dual 3Ghz Xeons, 4GB ram
1 million hits daily
~ 10 vhosts:
ËÌÉÅÎÔÁÍ ÞÁÓÔÏ ×ÙÌÅÔÁÅÔ "500 Internal Server Error"
× error log ÍÎÏÇÏ ÔÁËÉÈ ÏÛÉÂÏË:
çÌÁ×ÎÁÑ ÐÒÏÂÌÅÍÍÁ (ÏÞÅÎØ ÍÎÏÇÏ)
"Too many open files" (š $ cat /proc/sys/fs/file-maxšš
>>>> 640000 )
2006/09/25 13:29:32 [alert] 26770#0: *632044 socket() failed (24: Too
many open files) while connecting to upstream, client: 212.68.161.66,
server:
www.russianamerica.com, URL:
"/top/logo/index.php?id=2401&logo=3", upstream:
"http://66.223.112.93:80/top/logo/index.php?id=2401&logo=3",
host: "
www.russianamerica.com",
referrer:
"http://www.obozrevatel.com.ua/"
2006/09/25 13:29:32 [alert] 26770#0: *647996 socket() failed (24: Too
many open files) while connecting to upstream, client: 24.167.53.180,
server:
www.russianamerica.com, URL:
"/top/logo/index.php?id=1809", upstream:
"http://66.223.112.93:80/top/logo/index.php?id=1809",
host: "
www.russianamerica.com",
referrer:
"http://www.ulitka.com/forum/mv/msg/22188/0//0/"
2006/09/25 13:29:32 [alert] 26770#0: *647997 socket() failed (24: Too
many open files) while connecting to upstream, client: 84.57.211.47,
server:
www.russianamerica.com, URL:
"/top/logo/index.php?id=5731", upstream:
"http://66.223.112.93:80/top/logo/index.php?id=5731",
host: "
www.russianamerica.com",
referrer:
"http://www.swinguru.co.il/"
2006/09/25 13:29:32 [alert] 26770#0: *647999 socket() failed (24: Too
many open files) while connecting to upstream, client: 195.66.152.2,
server:
www.russianamerica.com, URL:
"/top/logo/index.php?id=5901", upstream:
"http://66.223.112.93:80/top/logo/index.php?id=5901",
host: "
www.russianamerica.com",
referrer:
"http://cripo.com.ua/?sect_id=2"
2006/09/25 13:29:32 [alert] 26770#0: *648034 socket() failed (24: Too
many open files) while connecting to upstream, client: 131.137.245.198,
server:
www.russianamerica.com, URL:
"/top/logo/index.php?id=2529&logo=3", upstream:
"http://66.223.112.93:80/top/logo/index.php?id=2529&logo=3",
host: "
www.russianamerica.com",
referrer:
"http://translation2.paralink.com/newbot.asp"
...
2006/09/25 14:53:33 [alert] 20827#0: *1158815 socket() failed (24: Too
many open files) while connecting to upstream, client: 212.176.204.130,
server:
www.russianboston.com, URL: "/gfx/back_top.gif", upstream:
"http://66.223.112.95:80/gfx/back_top.gif", host:
"
www.russianboston.com", referrer:
"http://www.russianboston.com/archive/j-article.php?id=26776"
2006/09/25 14:53:33 [alert] 20827#0: *1158743 socket() failed (24: Too
many open files) while connecting to upstream, client: 4.252.98.40,
server:
www.russianamerica.com, URL: "/top/logo/index.php?id=6323",
upstream:
"http://66.223.112.93:80/top/logo/index.php?id=6323", host:
"
www.russianamerica.com", referrer:
"http://www.seewomenfree.com/links.htm"
2006/09/25 14:53:33 [crit] 20827#0: *1158819 open()
"/usr/local/nginx/html/ra/images/banner/top_ani.gif" failed (24: Too
many open files), client: 62.197.114.146, server:
www.russianamerica.com, URL: "/images/banner/top_ani.gif", host:
"
www.russianamerica.com", referrer:
"http://translit.ru/"
2006/09/25 14:53:33 [alert] 20827#0: accept() failed (24: Too many open
files) while accepting new connection on 66.223.113.86:80
÷ÔÏÒÉÞÎÁÑ ÐÒÏÂÌÅÍÍÁ:
110: Connection timed out:š ( ÔË ÓÅÒ×ÅÒÁ ÎÅ ÎÁÇÒÕÖÅÎÙ - ÔÏ ×ÓÅ ÄÏÌÖÎÏ
ÂÙÔØ OK )
2006/09/25 13:00:45 [error] 26770#0: *454684 upstream timed out (110:
Connection timed out) while connecting to upstream, client:
85.202.58.31, server:
www.russianamerica.com, URL:
"/top/logo/index.php?id=2401&logo=3", upstream:
"http://66.223.112.93:80/top/logo/index.php?id=2401&logo=3",
host: "
www.russianamerica.com",
referrer:
"http://www.obozrevatel.com/news/2006/9/25/137099.htm"
2006/09/25 13:00:45 [error] 26770#0: *454700 upstream timed out (110:
Connection timed out) while connecting to upstream, client:
84.188.85.92, server:
www.russianamerica.com, URL:
"/cg/ratop.gif", upstream:
"http://66.223.112.93:80/cg/ratop.gif",
host: "
www.russianamerica.com",
referrer:
"http://www.cccp.de/telegram/index.php"
þÔÏ É ÇÄÅ ÎÕÖÎÏ ÐÏÄÐÒÁ×ÉÔØ??
ëÁËÉÅ ÏÐÃÉÉ ÎÁÄÏ ÄÏÂÁ×ÉÔØ??
current config:
$ cat nginx.conf
worker_processesš 2;
error_logš /var/log/nginx/error.log;
pidššššššš /var/run/nginx.pid;
events {
ššš worker_connectionsš 1024;
}
http {
ššš includešššššš conf/mime.types;
ššš default_typeš application/octet-stream;
ššš log_formatš mainš '$remote_addr [$time_local] $status '
ššššššššššššššššššššš '"$request"';
ššš access_logšš /var/log/nginx/access_logš main;
ššš gzipš on;
ššš gzip_min_lengthš 1100;
ššš gzip_buffersšššš 4 8k;
ššš gzip_typesšššššš text/plain;
ššš sendfilešššššššš on;
ššš tcp_nopushšššššš on;
ššš tcp_nodelayššššš on;
ššš keepalive_timeoutš 75 20;
ššš server {
ššššššš listenšššššš ra.ng:80;
ššššššš server_nameš
www.russianamerica.com;
ššššššš location / {
ššššššššššš proxy_pass
http://ra/;
ššššššššššš proxy_set_headeršš Hostšššššššššššš $host;
ššššššššššš proxy_set_headeršš X-Real-IPššššššš $remote_addr;
ššššššš }
ššššššš location /cg/ratop.gif {
ššššššššš root /usr/local/nginx/html/ra;
ššššššššš access_log off;
ššššššš }
ššššššš location /cg/0.gif {
ššššššššš root /usr/local/nginx/html/ra;
ššššššššš access_log off;
ššššššš }
ššššššš location /images/banner/top_ani.gif {
ššššššššš root /usr/local/nginx/html/ra;
ššššššššš access_log off;
ššššššš }
ššššššš location /gfx/ {
ššššššššš root /usr/local/nginx/html/ra;
ššššššššš access_log off;
ššššššš }
ššš }
ššš server {
ššššššš listenšššššš rb.ng:80;
ššššššš server_nameš
www.russianboston.com;
ššššššš location / {
ššššššššššš proxy_pass
http://rb/;
ššššššššššš proxy_set_headeršš Hostšššššššššššš $host;
ššššššššššš proxy_set_headeršš X-Real-IPššššššš $remote_addr;
ššššššš }
ššššššš location /gfx/ {
ššššššššš root /usr/local/nginx/html/rb;
ššššššššš access_log off;
ššššššš }
ššš }
ššš server {
ššššššš listenšššššš rla.ng:80;
ššššššš server_nameš
www.russianla.com;
ššššššš location / {
ššššššššššš proxy_pass
http://rla/;
ššššššššššš proxy_set_headeršš Hostšššššššššššš $host;
ššššššššššš proxy_set_headeršš X-Real-IPššššššš $remote_addr;
ššššššš }
ššššššš location /gfx/ {
ššššššššš root /usr/local/nginx/html/rla;
ššššššššš access_log off;
ššššššš }
ššš }
ššš server {
ššššššš listenšššššš forum.ng:80;
ššššššš server_nameš forum.russianamerica.com;
ššššššš location / {
ššššššššššš proxy_pass
http://forum/;
ššššššššššš proxy_set_headeršš Hostšššššššššššš $host;
ššššššššššš proxy_set_headeršš X-Real-IPššššššš $remote_addr;
ššššššš }
ššš }
}