Welcome! Log In Create A New Profile

Advanced

Re: Dead backend detection

November 25, 2011 12:58PM
On 11/25/11 19:06, Maxim Dounin wrote:
> Hello!
>
> On Fri, Nov 25, 2011 at 04:36:36PM +0200, Sergey Kobzar wrote:
>
>> Что-то совсем запутался...
>>
>> Ушел ответ с бэкенда, все ОК 200:
>>
>> 207.241.237.226 - - [25/Nov/2011:14:28:11 +0000] "GET
>> /Companies/t-d-advertising-marketing/0210001218642 HTTP/1.0" 200
>> 62021 "-" "Mozilla/5.0 (compatible; archive.org_bot
>> +http://www.archive.org/details/archive.org_bot)" "-"
>>
>> ловлю его фронтэндом:
>> 207.241.237.226 - - [25/Nov/2011:14:28:11 +0000] "GET
>> /Companies/t-d-advertising-marketing/0210001218642 HTTP/1.0" 502
>> 9574 "-" "Mozilla/5.0 (compatible; archive.org_bot
>> +http://www.archive.org/details/archive.org_bot)" "-" 10.17.92.2:80
>> 502 0.055
>>
>> 502 ошибка. Последние 3 поля:
>> - бэкенд
>> - код ответа от бэкенда
>
> Всмысле - $upstream_status? Там будет 502, если например бекенд
> ответил некорректно.

Угу. Но почему с бэкенда улетает 200, а с фронтенда 502?


> Ну и ещё я бы рекомендовал лишний раз убедиться, что запрос
> действительно правильно идентифицирован.

Не понял.


>> - время ответа
>>
>> конфиг фронтенда:
>>
>> upstream backend {
>> server 10.17.92.2 max_fails=3 fail_timeout=300s;
>> # server 10.17.92.12 max_fails=3 fail_timeout=300s;
>> # server 127.0.0.1 backup;
>> ip_hash;
>> }
>>
>> server {
>> listen 80 default;
>> server_name localhost;
>>
>> access_log /var/log/nginx/default_access.log main;
>> error_log /var/log/nginx/default_error.log info;
>>
>> location / {
>> proxy_pass http://backend;
>> # proxy_next_upstream error timeout http_502 http_504;
>>
>> proxy_set_header Host $host;
>> proxy_set_header X-Real-IP $remote_addr;
>> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
>> }
>>
>> error_page 502 504 /errors/500.html;
>>
>> location ^~ /errors/ {
>> root /home/www/localhost/htdocs;
>> expires max;
>> }
>> }
>>
>> Что не так?
>
> Обычно помогает заглянуть в error_log.

:)

Ну там (error log на бэкенде) относительно чисто. Периодически проскакивет

2011/11/25 17:51:17 [info] 12202#0: *1707332 client closed prematurely
connection, so upstream connection is closed too while sending request
to upstream, client: 163.178.119.90, server: localhost, request: "GET
/locations/San-jose/San-pedro HTTP/1.0", upstream:
"fastcgi://127.0.0.1:9001", host: "www.abc.com", referrer:
"http://www.abc.com/Companies/barber%C3%ADa-rex/1310003560"

tail -f /var/log/nginx/default_access.log | grep 'HTTP/1.0" 502'
Вообще молчит как партизан.


На фронтенде в error_log только записи типа
2011/11/25 17:55:00 [info] 4267#0: *4238782 client 94.63.71.59 closed
keepalive connection
2011/11/25 17:55:00 [info] 4256#0: *4248177 client 66.249.71.70 closed
keepalive connection
2011/11/25 17:55:00 [info] 4261#0: *4249970 client 207.46.199.54 closed
keepalive connection (104: Connection reset by peer)
2011/11/25 17:55:00 [info] 4270#0: *4249800 recv() failed (104:
Connection reset by peer) while sending to client, client:
123.125.71.113, server: localhost, request: "GET
/hk/Companies/m-two/11600063595 HTTP/1.1", upstream:
"http://10.17.92.2:80/hk/Companies/m-two/11600063595", host: "abc.com"



>
> Maxim Dounin
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru

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

Dead backend detection

sergey.kobzar November 22, 2011 05:52PM

Re: Dead backend detection

Maxim Dounin November 23, 2011 02:56AM

Re: Dead backend detection

sergey.kobzar November 23, 2011 05:00AM

Re: Dead backend detection

Maxim Dounin November 23, 2011 07:54AM

Re: Dead backend detection

sergey.kobzar November 23, 2011 08:12AM

Re: Dead backend detection

sergey.kobzar November 25, 2011 09:38AM

Re: Dead backend detection

Maxim Dounin November 25, 2011 12:08PM

Re: Dead backend detection

sergey.kobzar November 25, 2011 12:58PM

Re: Dead backend detection

sergey.kobzar November 25, 2011 01:02PM

Re: Dead backend detection

sergey.kobzar November 25, 2011 01:08PM

Re: Dead backend detection

sergey.kobzar November 25, 2011 06:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 137
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