<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Ruslan,<br>
      <br>
      Not sure if I know a good article on the topic.<br>
      Just ensure proxy_buffering is 'on', proxy_buffer size covers
      maximum possible reply headers  size and proxy_buffers matches 90%
      margin of your replies (or whatever you think is appropriate).<br>
      Most of time these recommendations ensures optimal performance for
      nginx as a proxy.<br>
      <br>
      But more interesting question is if you really need to tune
      anything. <br>
      If your front edge servers are well loaded, do you really need to
      load them even more?<br>
      <br>
      May be someone else will help with a proper text to read.<br>
      <br>
      On 08.05.2018 21:04, Руслан Закиров wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAABS+4mqrEZusc13noi1AcrOaKVOU4+GaRQsa=-77=-dYSsegg@mail.gmail.com">
      <div dir="ltr"><br>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Tue, May 8, 2018 at 7:22 PM, Igor
            A. Ippolitov <span dir="ltr"><<a
                href="mailto:iippolitov@nginx.com" target="_blank"
                moz-do-not-send="true">iippolitov@nginx.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF">
                <div class="m_-8669105614435491400moz-cite-prefix">Ruslan,<br>
                  <br>
                  This depends on your routing nginx configuration. <br>
                  If doesn't have enough buffers to contain a response
                  completely and temporary files are turned off, then
                  you will run into a situation, when the delay is
                  propagated from client facing nginx to a middle layer
                  nginx.<br>
                  <br>
                  The fact that only client facing requests are affected
                  proves this idea.</div>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>Sure it sounds very much like my case. Any pointers on
              good article on this subject? Probably my goal is to free
              "primary" nginx servers as soon as possible and leave last
              mile delivery job to "routing" nginx in front. If there is
              no articles you know about on this matter then just point
              me at nginx options I should start from.</div>
            <div><br>
            </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF">
                <div class="m_-8669105614435491400moz-cite-prefix">
                  <div>
                    <div class="h5"><br>
                      On 08.05.2018 18:51, Руслан Закиров wrote:<br>
                    </div>
                  </div>
                </div>
                <div>
                  <div class="h5">
                    <blockquote type="cite">
                      <div dir="ltr"><br>
                        <div class="gmail_extra"><br>
                          <div class="gmail_quote">On Tue, May 8, 2018
                            at 3:11 PM, Igor A. Ippolitov <span
                              dir="ltr"><<a
                                href="mailto:iippolitov@nginx.com"
                                target="_blank" moz-do-not-send="true">iippolitov@nginx.com</a>></span>
                            wrote:<br>
                            <blockquote class="gmail_quote"
                              style="margin:0 0 0 .8ex;border-left:1px
                              #ccc solid;padding-left:1ex">
                              <div text="#000000" bgcolor="#FFFFFF">
                                <div
                                  class="m_-8669105614435491400m_7437294295156398557moz-cite-prefix">Sorry,
                                  didn't realize this is an English
                                  mailing list.<br>
                                  <br>
                                  To sum it up: the problem is most
                                  likely about clients and not the
                                  server.<br>
                                  Discrepancy between request time and
                                  upstream time usually means that a
                                  client is slow or uses a bad
                                  connection.<br>
                                  Basically, this is OK unless you have
                                  the only server out of many with this
                                  problem. <br>
                                  This in turn may mean that the problem
                                  is with that server's network
                                  connection.<br>
                                </div>
                              </div>
                            </blockquote>
                            <div><br>
                            </div>
                            <div><br>
                            </div>
                            <div>The issue affects all of our primary
                              nginx servers.</div>
                            <div><br>
                            </div>
                            <div>However, they receive requests from 4
                              "routing" nginx servers and all backends
                              via haproxy. The problem affects only</div>
                            <div>requests from the routing nginxs, not
                              backends. I would expect routing servers
                              pull data from upstream ASAP. So slow</div>
                            <div>clients in my mind should only affect
                              those routing servers standing in front.</div>
                            <div><br>
                            </div>
                            <div>Am I wrong?</div>
                            <div><br>
                            </div>
                            <blockquote class="gmail_quote"
                              style="margin:0 0 0 .8ex;border-left:1px
                              #ccc solid;padding-left:1ex">
                              <div text="#000000" bgcolor="#FFFFFF">
                                <div
                                  class="m_-8669105614435491400m_7437294295156398557moz-cite-prefix">
                                  <br>
                                  Regards.
                                  <div>
                                    <div
                                      class="m_-8669105614435491400h5"><br>
                                      <br>
                                      On 08.05.2018 14:50, Igor A.
                                      Ippolitov wrote:<br>
                                    </div>
                                  </div>
                                </div>
                                <div>
                                  <div class="m_-8669105614435491400h5">
                                    <blockquote type="cite">
                                      <div
                                        class="m_-8669105614435491400m_7437294295156398557moz-cite-prefix">Можно
                                        я отвечу ссылкой? <a
                                          class="m_-8669105614435491400m_7437294295156398557moz-txt-link-freetext"
href="http://mailman.nginx.org/pipermail/nginx/2008-October/008025.html"
                                          target="_blank"
                                          moz-do-not-send="true">http://mailman.nginx.org/piper<wbr>mail/nginx/2008-October/008025<wbr>.html</a><br>
                                        Проблема, скорее всего, в
                                        клиентах.<br>
                                        <br>
                                        On 08.05.2018 14:43, Руслан
                                        Закиров wrote:<br>
                                      </div>
                                      <blockquote type="cite">
                                        <div dir="ltr">Hello,
                                          <div><br>
                                          </div>
                                          <div>Some selected log
                                            records: </div>
                                          <div>
                                            <div>14:27:46 1.609 [0.013]
                                              [0.002] [<a
                                                href="http://192.168.1.44:5002"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.44:5002</a>]</div>
                                            <div>14:27:50 1.017 [0.017]
                                              [0.001] [<a
                                                href="http://192.168.1.24:9000"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.24:9000</a>]</div>
                                            <div>14:27:51 1.522 [0.021]
                                              [0.000] [<a
                                                href="http://192.168.1.92:9000"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.92:9000</a>]</div>
                                            <div>14:27:50 1.019 [0.019]
                                              [0.000] [<a
                                                href="http://192.168.1.41:9000"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.41:9000</a>]</div>
                                            <div>14:27:52 1.019 [0.018]
                                              [0.000] [<a
                                                href="http://192.168.1.49:9000"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.49:9000</a>]</div>
                                            <div>14:27:52 1.019 [0.018]
                                              [0.001] [<a
                                                href="http://192.168.1.59:9000"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.59:9000</a>]</div>
                                            <div>14:27:55 1.515 [0.014]
                                              [0.000] [<a
                                                href="http://192.168.1.92:9000"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.92:9000</a>]</div>
                                            <div>14:27:57 0.510 [0.010]
                                              [0.001] [<a
                                                href="http://192.168.1.21:9000"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.21:9000</a>]</div>
                                            <div>14:28:03 1.521 [0.021]
                                              [0.001] [<a
                                                href="http://192.168.1.48:9000"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.48:9000</a>]</div>
                                            <div>14:28:04 0.660 [0.007]
                                              [0.002] [<a
                                                href="http://192.168.1.24:5002"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.24:5002</a>]</div>
                                            <div>14:28:05 2.216 [0.018]
                                              [0.002] [<a
                                                href="http://192.168.1.44:5002"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.44:5002</a>]</div>
                                            <div>14:28:11 0.510 [0.010]
                                              [0.000] [<a
                                                href="http://192.168.1.49:9000"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.49:9000</a>]</div>
                                            <div>14:28:26 0.937 [0.008]
                                              [0.002] [<a
                                                href="http://192.168.1.92:5002"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.92:5002</a>]</div>
                                            <div>14:28:28 1.019 [0.019]
                                              [0.000] [<a
                                                href="http://192.168.1.49:9000"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.49:9000</a>]</div>
                                            <div>14:28:28 0.508 [0.007]
                                              [0.000] [<a
                                                href="http://192.168.1.42:9000"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.42:9000</a>]</div>
                                            <div>14:28:31 1.021 [0.019]
                                              [0.000] [<a
                                                href="http://192.168.1.44:9000"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.44:9000</a>]</div>
                                            <div>14:28:32 0.509 [0.008]
                                              [0.000] [<a
                                                href="http://192.168.1.48:9000"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.48:9000</a>]</div>
                                            <div>14:28:36 1.015 [0.015]
                                              [0.000] [<a
                                                href="http://192.168.1.43:9000"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.43:9000</a>]</div>
                                            <div>14:28:39 0.358 [0.007]
                                              [0.001] [<a
                                                href="http://192.168.1.92:5002"
                                                target="_blank"
                                                moz-do-not-send="true">192.168.1.92:5002</a>]</div>
                                            <div><br>
                                            </div>
                                            <div>columns: wallclock
                                              time, request time,
                                              upstream_request_time,
                                              upstream_connect_time,
                                              upstream.</div>
                                            <div><br>
                                            </div>
                                            <div>Please, help me
                                              diagnose this problem
                                              further as I stuck. This
                                              is subset where
                                              request_time 50x bigger
                                              than upstream_request_time
                                              (just to make subset less
                                              noisy). I see request
                                              times up to 60 seconds.
                                              Can not tie it to some
                                              periodicity. It happens so
                                              often that don't see
                                              anything helpful in
                                              strace... I stuck... Any
                                              ideas?</div>
                                            <div><br>
                                            </div>
                                            <div>This is nginx/1.10.2
                                              on FreeBSD
                                              10.3-RELEASE-p7.</div>
                                            <div><br>
                                            </div>
                                            -- <br>
                                            <div
                                              class="m_-8669105614435491400m_7437294295156398557gmail_signature">
                                              <div dir="ltr">
                                                <div>Руслан Закиров</div>
                                                <div>Руководитель отдела
                                                  разработки
                                                  веб-сервисов</div>
                                                <div><span>+7(916)
                                                    597-92-69</span>, <span>ruz @ <a
href="http://www.sports.ru/" target="_blank" moz-do-not-send="true"><img
src="http://farm7.static.flickr.com/6235/6210250811_19a888dbba_o.jpg"
                                                        style="vertical-align:bottom;margin-right:0px"
moz-do-not-send="true" height="14" width="43"></a></span></div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                        <br>
                                        <fieldset
                                          class="m_-8669105614435491400m_7437294295156398557mimeAttachmentHeader"></fieldset>
                                        <br>
                                        <pre>______________________________<wbr>_________________
nginx mailing list
<a class="m_-8669105614435491400m_7437294295156398557moz-txt-link-abbreviated" href="mailto:nginx@nginx.org" target="_blank" moz-do-not-send="true">nginx@nginx.org</a>
<a class="m_-8669105614435491400m_7437294295156398557moz-txt-link-freetext" href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank" moz-do-not-send="true">http://mailman.nginx.org/mailm<wbr>an/listinfo/nginx</a></pre>
                                      </blockquote>
                                      <p><br>
                                      </p>
                                      <br>
                                      <fieldset
                                        class="m_-8669105614435491400m_7437294295156398557mimeAttachmentHeader"></fieldset>
                                      <br>
                                      <pre>______________________________<wbr>_________________
nginx mailing list
<a class="m_-8669105614435491400m_7437294295156398557moz-txt-link-abbreviated" href="mailto:nginx@nginx.org" target="_blank" moz-do-not-send="true">nginx@nginx.org</a>
<a class="m_-8669105614435491400m_7437294295156398557moz-txt-link-freetext" href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank" moz-do-not-send="true">http://mailman.nginx.org/mailm<wbr>an/listinfo/nginx</a></pre>
                                    </blockquote>
                                    <p><br>
                                    </p>
                                  </div>
                                </div>
                              </div>
                              <br>
                              ______________________________<wbr>_________________<br>
                              nginx mailing list<br>
                              <a href="mailto:nginx@nginx.org"
                                target="_blank" moz-do-not-send="true">nginx@nginx.org</a><br>
                              <a
                                href="http://mailman.nginx.org/mailman/listinfo/nginx"
                                rel="noreferrer" target="_blank"
                                moz-do-not-send="true">http://mailman.nginx.org/mailm<wbr>an/listinfo/nginx</a><br>
                            </blockquote>
                          </div>
                          <br>
                          <br clear="all">
                          <div><br>
                          </div>
                          -- <br>
                          <div
                            class="m_-8669105614435491400gmail_signature"
                            data-smartmail="gmail_signature">
                            <div dir="ltr">
                              <div>Руслан Закиров</div>
                              <div>Руководитель отдела разработки
                                веб-сервисов</div>
                              <div><span>+7(916) 597-92-69</span>, <span>ruz @ <a
                                    href="http://www.sports.ru/"
                                    target="_blank"
                                    moz-do-not-send="true"><img
                                      src="http://farm7.static.flickr.com/6235/6210250811_19a888dbba_o.jpg"
style="vertical-align:bottom;margin-right:0px" moz-do-not-send="true"
                                      height="14" width="43"></a></span></div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <br>
                      <fieldset
                        class="m_-8669105614435491400mimeAttachmentHeader"></fieldset>
                      <br>
                      <pre>______________________________<wbr>_________________
nginx mailing list
<a class="m_-8669105614435491400moz-txt-link-abbreviated" href="mailto:nginx@nginx.org" target="_blank" moz-do-not-send="true">nginx@nginx.org</a>
<a class="m_-8669105614435491400moz-txt-link-freetext" href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank" moz-do-not-send="true">http://mailman.nginx.org/<wbr>mailman/listinfo/nginx</a></pre>
                    </blockquote>
                    <p><br>
                    </p>
                  </div>
                </div>
              </div>
              <br>
              ______________________________<wbr>_________________<br>
              nginx mailing list<br>
              <a href="mailto:nginx@nginx.org" moz-do-not-send="true">nginx@nginx.org</a><br>
              <a href="http://mailman.nginx.org/mailman/listinfo/nginx"
                rel="noreferrer" target="_blank" moz-do-not-send="true">http://mailman.nginx.org/<wbr>mailman/listinfo/nginx</a><br>
            </blockquote>
          </div>
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <div class="gmail_signature" data-smartmail="gmail_signature">
            <div dir="ltr">
              <div>Руслан Закиров</div>
              <div>Руководитель отдела разработки веб-сервисов</div>
              <div><span>+7(916) 597-92-69</span>, <span>ruz @ <a
                    href="http://www.sports.ru/" target="_blank"
                    moz-do-not-send="true"><img
                      src="http://farm7.static.flickr.com/6235/6210250811_19a888dbba_o.jpg"
                      style="vertical-align:bottom;margin-right:0px"
                      moz-do-not-send="true" height="14" width="43"></a></span></div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
nginx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:nginx@nginx.org">nginx@nginx.org</a>
<a class="moz-txt-link-freetext" href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a></pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>