Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
upstream и ip_hash
- To: nginx-ru@xxxxxxxxx
- Subject: upstream и ip_hash
- From: Igor Savchenko <dicsydel@xxxxxxxxx>
- Date: Fri, 2 Mar 2007 11:11:38 +0200
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:from:x-mailer:reply-to:organization:x-priority:message-id:to:subject:mime-version:content-type:content-transfer-encoding; b=m7RNhU2uKcew0G2j7MeiP90c7De9XvY6Nkyi6/naE2di1BUv0EMsjuGMZ34EM90EiEhcHjocgUdkVNsr9G13cgGlPe3dCvZKeiJTyrrBMZvVqt8mtEAbkoqE4bhZ7ACNZrS0v6q7OeuZLzOw/D6rB52nNqDx0HveiexJy+zQGVo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:x-mailer:reply-to:organization:x-priority:message-id:to:subject:mime-version:content-type:content-transfer-encoding; b=AdKS4+ny/kUVQkWZ1MTC8Zh7R8UHOek9vxCtiljvioo6kZGXq6EAveVUzOOfOt5OcCKJNr7FAny0mAfbiGrHSZuxD1f8FYJHwGy0eLK7OfBLdefhgokY9Pf6uRsRPJljgMKDi7StE2hBCAvsPElSwtb4ADeEhVG0BXswLqierPM=
- Organization: Webta
Hello nginx-ru,
конфиг:
worker_processes 10;
events {
worker_connections 1024;
}
http {
include conf/mime.types;
default_type application/octet-stream;
access_log off;
error_log off;
sendfile on;
keepalive_timeout 20;
tcp_nodelay on;
upstream backend {
ip_hash;
server xxx.xxx.xxx.xxx:80;
server xxx.xxx.xxx.xxx:80;
}
server {
listen xxx.xxx.xxx.xxx:80;
server_name xxxxxxxxx.com;
location / {
proxy_pass http://backend;
proxy_redirect off;
proxy_buffering on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 20;
proxy_send_timeout 20;
proxy_read_timeout 20;
proxy_buffer_size 8k;
proxy_buffers 20 64k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
location ~*
^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js)$
{
root /www/www;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
При этом второй бекенд загружен практически под завязку, а первый
стоит холодный. Такое ощущение что 90% запросов идут на второй бекенд.
Это нормально? Как сделать чтобы нагрузка была более-менее
равномерной?
---------------------------------
Igor V. Savchenko
http://webta.net
mailto: igor@xxxxxxxxx
ICQ: 86915046
|