Welcome! Log In Create A New Profile

Advanced

Проблема с Upstream

February 16, 2012 03:18AM
Доброго дня! Хотелось бы детально прояснить ситуёвину - у меня имеются 2
бекенда на lighttpd и 1 фронтенд на nginx (1.1.12) который я периодически
пытаюсь
запустить в качестве балансирующего реверса. Вот его конфиг:

user nginx;
worker_processes 16;
worker_priority -15;

error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;

timer_resolution 100ms;
worker_rlimit_nofile 1024;

events {
worker_connections 512;
use epoll;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

limit_conn_zone $binary_remote_addr zone=myzone:10m;
proxy_cache_path /var/cache/nginx levels=2 keys_zone=pagecache:5m
inactive=10m max_size=50m;
proxy_cache off;
client_body_buffer_size 128K;
client_header_buffer_size 4k;
client_max_body_size 2048M;
large_client_header_buffers 16 8k;


output_buffers 32 64k;
postpone_output 1460;

lingering_time 30;
lingering_timeout 10;
reset_timedout_connection on;

client_header_timeout 90;
client_body_timeout 90;

expires 2m;
keepalive_timeout 60;
send_timeout 10m;

ignore_invalid_headers on;
keepalive_requests 100;
limit_conn_zone $binary_remote_addr zone=gulag:5m;
recursive_error_pages on;
sendfile on;
server_name_in_redirect on;
server_tokens off;

tcp_nodelay on;
tcp_nopush on;

gzip off;
gzip_buffers 32 64k;
gzip_comp_level 6;
gzip_proxied any;
gzip_disable "msie6"
gzip_http_version 1.0;
gzip_min_length 4096;
gzip_types application/x-javascript text/css text/xml text/plain;
gzip_vary off;


server {
listen 0.0.0.0:80;
location / {
proxy_pass http://backends;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;
}

location /status {
stub_status on;
access_log off;
}
}

upstream backends {
ip_hash;
server 192.168.50.1:8080 max_fails=3 fail_timeout=30s;
server 192.168.50.3:8080 down;
}

}

Как вы можете видеть последний апстрим потушен, в результате чего второй
бэкенд у меня простаивает. Стоит только поключить его как мгновенно
возрастает время отклика бэкендов раза в 2-3. Что не так в моем конфиге?
Или это nginx такой "шустрый"?

P.S. Еще интересно куда делись директивы weight и backup? Стоит их
прописать в конфиге апстримов как nginx начинает ругаться матом говоря что
не знает сих директив, а они мне очень бы пригодились, поскольку в случае
успешного решения сабжевой проблемы планируется ввод еще 2 бэкендов.


_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

Проблема с Upstream

Raven_kg February 16, 2012 03:18AM

Re: Проблема с Upstream

Maxim Dounin February 16, 2012 04:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 302
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready