<HTML><BODY>Доброго времени суток.<br><br>Суть проблемы: пришел запрос, ушел на бекенд. Если бекенд не ответил за 2 секунды , nginx перестает ждать и отправляет еще один аналогичный запрос на бекенд, который отвергает приложение ввиду того что все еще занято прошлым запросом(на таблицах висят локи и пр).<br><br>Вопрос: Почему nginx может не ждать выполнения а дублировать запрос спустя 2 секунды.<br><br>Вот немного деталей.<br><br><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">nginx version: nginx/1.11.6</span></p><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">built by gcc 4.8.2 (Ubuntu 4.8.2-19ubuntu1) </span></p><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">built with OpenSSL 1.0.1f 6 Jan 2014</span></p><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">TLS SNI support enabled</span></p><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">configure arguments: --prefix=/usr/share/nginx --with-cc-opt='-I /usr/include' --with-ld-opt='-L /usr/lib' --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/nginx-error.log --user=www-data --group=www-data --with-file-aio --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx/nginx-access.log --with-http_perl_module --with-http_stub_status_module --with-pcre --with-http_ssl_module --add-module=/usr/src/ngx_devel_kit-0.2.19 --add-module=/usr/src/lua-nginx-module --add-module=/usr/src/echo-nginx-module --with-debug --with-http_realip_module --add-module=/usr/src/nginx_upstream_check_module</span><br></p><br><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">client_max_body_size 300m;</span></p><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">client_body_buffer_size 128k;</span></p><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">proxy_read_timeout 180s;</span></p><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">proxy_send_timeout 180s;<br></span></p><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">proxy_connect_timeout 10s;</span></p><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">proxy_http_version 1.1;</span></p><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">proxy_set_header Connection keep-alive;<br></span></p><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">proxy_next_upstream error;</span></p><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"></span></p><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">proxy_next_upstream_timeout 30s;</span></p><p style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);" data-mce-style="margin-bottom: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: #f4f4f4; background-color: rgba(0, 0, 0, 0.85098);"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"><br></span></p><br><strong style="font-family: monospace;" data-mce-style="font-family: monospace;">proxy_ignore_client_abort</strong><span style="font-family: monospace; font-size: medium; background-color: #f2f2f2;" data-mce-style="font-family: monospace; font-size: medium; background-color: #f2f2f2;"> </span><code>on пробовал, не помогло.</code><br><br>Вот вывод strike детки которая обрабатывала запрос: <a href="http://pastebin.com/raw/HFP9tNNm">http://pastebin.com/raw/HFP9tNNm</a> <br><strong>Интересно что делал nginx между 23:32:10 и 23:32:12</strong><br><br>Вот вывод debug лога: <a href="http://pastebin.com/raw/SQhXKVQ9">http://pastebin.com/raw/SQhXKVQ9</a> <br><br>Куда копать дальше ? <br><br>Спасибо.<br><br>-- <br>Никита Маслянников</BODY></HTML>