Welcome! Log In Create A New Profile

Advanced

php-fpm upstream pool

November 25, 2011 08:06AM
Hi!

Тестирую php-fpm пул и nginx балансером к нему. Требования - если один или несколько из серверов пула начинают отвечать дольше чем 30 сек - запрос отправлять на другой сервер пула:

nginx.conf:

http {

{skip}

fastcgi_connect_timeout 3;
fastcgi_next_upstream error timeout invalid_header;
fastcgi_read_timeout 30;
fastcgi_send_timeout 3;

{skip}

vhost.conf:

{skip}

upstream fcgi_proxy {
server 10.0.0.10:9000 max_fails=1 fail_timeout=240s; # answer more than 60 sec
server 10.0.0.11:9000 max_fails=1 fail_timeout=240s; # answer more than 60 sec
server 10.0.0.12:9000 max_fails=1 fail_timeout=240s; # ok
}


location ~ ^/fcgi_proxy/$ {

include /usr/local/etc/nginx/fastcgi_params;

fastcgi_param SCRIPT_FILENAME /home/fcgi_proxy/index.php;
fastcgi_param HOST $host;
fastcgi_pass fcgi_proxy;

allow all;
}

{skip}

Пул работает отлично пока два сервера их трех начинают отвечать долго (см коментарий в upstream, эмулируем timeout больше 30 сек). В этом случае проскакивают такие ошибки:

10.0.0.1 - - [25/Nov/2011:12:38:26 +0000] "GET /fcgi-proxy/ HTTP/1.1" 504 1205 "-" "JoeDog/1.00 [en] (X11; I; Siege 2.70)" "-" "10.0.0.10:9000, 10.0.0.11:9000 : 10.0.0.12:80 504, 504 : 404 - 30.008, 30.007 : 0.002" 60.017 SSL:-/- "gzip:-"

То-есть 2 первых сервера их пула "ответили" 504 (не отработали по таймауту), третий отработал правильно и вызад 404 (в данном случае это корректный ответ), но клиент все равно получил 504 ответ, хотя как я понимаю, должен был получить 404.

и вот это еще странно 10.0.0.12:80 - откуда берется 80 порт?


Таких ошибок всего 5 из 5000 (1000 concurrent = 5):
$siege fcgi-proxy-test.com/fcgi-proxy/ -d1 -r1000

Transactions: 4995 hits
Availability: 99.90 %
{skip}
Failed transactions: 5


лог siege:
HTTP/1.1 404 0.01 secs: 41 bytes ==> /fcgi-proxy/
{skip}
HTTP/1.1 504 60.02 secs: 1205 bytes ==> /fcgi-proxy/
HTTP/1.1 504 60.04 secs: 1205 bytes ==> /fcgi-proxy/
HTTP/1.1 504 60.02 secs: 1205 bytes ==> /fcgi-proxy/
HTTP/1.1 504 60.03 secs: 1205 bytes ==> /fcgi-proxy/
HTTP/1.1 504 60.02 secs: 1205 bytes ==> /fcgi-proxy/
{skip}
HTTP/1.1 404 0.00 secs: 41 bytes ==> /fcgi-proxy/

Siege сам не рвет сессии (у него стоит timeout = 600 и тогда я бы видел в логе 499 ошибку). Подскажите, что не так в этой конфигурации пула?

freebsd 8.2 i386/nginx-1.0.10_1,1


---
Igor
Subject Author Posted

php-fpm upstream pool

igor.goncharenko November 25, 2011 08:06AM

Re: php-fpm upstream pool

Maxim Dounin November 25, 2011 09:44AM

Re: php-fpm upstream pool

igor.goncharenko November 25, 2011 10:11AM

Re: php-fpm upstream pool

Nefer November 25, 2011 10:30AM

Re: php-fpm upstream pool

igor.goncharenko November 25, 2011 11:24AM

Re: php-fpm upstream pool

igor.goncharenko November 29, 2011 09:39AM

Re: php-fpm upstream pool

Maxim Dounin November 29, 2011 10:16AM

Re: php-fpm upstream pool

igor.goncharenko November 29, 2011 10:48AM

Re: php-fpm upstream pool

Maxim Dounin November 29, 2011 01:16PM

Re: php-fpm upstream pool

igor.goncharenko November 30, 2011 03:08AM

Re: php-fpm upstream pool

igor.goncharenko December 01, 2011 09:19AM

Re: php-fpm upstream pool

Maxim Dounin December 01, 2011 12:14PM

Re: php-fpm upstream pool

igor.goncharenko December 02, 2011 03:47AM

Re: php-fpm upstream pool

Maxim Dounin December 02, 2011 05:08AM

Re: php-fpm upstream pool

Gena Makhomed December 02, 2011 05:54AM

Re[2]: php-fpm upstream pool

Andrey Repin December 02, 2011 08:52AM

Re: php-fpm upstream pool

Gena Makhomed December 02, 2011 10:54AM

Re: php-fpm upstream pool

Валентин Бартенев December 02, 2011 11:04AM

Re: php-fpm upstream pool

Gena Makhomed December 02, 2011 11:12AM

Re: php-fpm upstream pool

Alexandr Gomoliako December 02, 2011 11:12AM

Re: php-fpm upstream pool

Gena Makhomed December 02, 2011 11:16AM

Re: php-fpm upstream pool

Валентин Бартенев December 02, 2011 11:18AM

Re: php-fpm upstream pool

Gena Makhomed December 02, 2011 12:12PM

Re: php-fpm upstream pool

Maxim Dounin December 02, 2011 12:52PM

Re: php-fpm upstream pool

Alexandr Gomoliako December 02, 2011 01:14PM

Re: php-fpm upstream pool

Alexandr Gomoliako December 02, 2011 01:16PM

Re: php-fpm upstream pool

Gena Makhomed December 02, 2011 01:52PM

Re: php-fpm upstream pool

Denis F. Latypoff December 02, 2011 03:02PM

Re: php-fpm upstream pool

Alexandr Gomoliako December 02, 2011 03:14PM

Re: php-fpm upstream pool

Gena Makhomed December 02, 2011 05:18PM

Re: php-fpm upstream pool

Sergej Kandyla December 14, 2011 11:50AM

Re: php-fpm upstream pool

Maxim Dounin December 14, 2011 12:06PM

Re: php-fpm upstream pool

Sergej Kandyla December 14, 2011 12:40PM

Re: php-fpm upstream pool

Denis F. Latypoff December 15, 2011 03:56AM

Re: php-fpm upstream pool

Sergej Kandyla December 15, 2011 11:16AM

Re: php-fpm upstream pool

igor.goncharenko December 14, 2011 10:19AM

Re: php-fpm upstream pool

Maxim Dounin December 14, 2011 11:52AM

Re: php-fpm upstream pool

igor.goncharenko December 14, 2011 02:38PM

Re: php-fpm upstream pool

Gena Makhomed December 14, 2011 12:56PM

Re: php-fpm upstream pool

Alexandr Gomoliako December 14, 2011 01:10PM

Re: php-fpm upstream pool

igor.goncharenko December 14, 2011 02:54PM

Re: php-fpm upstream pool

Alexandr Gomoliako December 14, 2011 03:40PM

Re: php-fpm upstream pool

Andrey N. Oktyabrski December 15, 2011 02:38AM

Re: php-fpm upstream pool

Alexandr Gomoliako December 15, 2011 02:12PM

Re[2]: php-fpm upstream pool

Andrey Repin December 16, 2011 02:52AM

Re: php-fpm upstream pool

Илья Шипицин December 18, 2011 01:46PM

Re: php-fpm upstream pool

Alexandr Gomoliako December 18, 2011 02:32PM

Re: php-fpm upstream pool

Илья Шипицин December 18, 2011 09:40PM

Re: php-fpm upstream pool

Gena Makhomed December 19, 2011 12:12PM

nginx_http_push_module и размер сообщения

Bdfy December 14, 2011 04:38PM

Re: nginx_http_push_module и размер сообщения

Илья Пирогов December 15, 2011 02:54AM

Re: php-fpm upstream pool

mathead December 22, 2011 05:07AM

Re: php-fpm upstream pool

Валентин Бартенев December 24, 2011 08:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 118
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready