0

Our nginx is configured to serve requests from 2 upstreams: php-fpm and memcached.

When request is served from php-fpm, $upstream_response_time has non-zero value.

When request is served from memcached, $upstream_response_time sometimes has zero value, not for every request.

Looking at logs, I can't determinate any patterns, don't observe any regularity. Http versions, urls and so on, differ.

For instance, see attached table from kibana, filleted by specific url:

Time                    upstream_response_time  request_time  status  request           page_from_memcached 

September 28th 2018, 15:26:04.000       0           0.052   200     GET /myra/bags/ HTTP/1.1    1
September 28th 2018, 15:13:22.000       0.001       0.001   200     GET /myra/ HTTP/1.1         1
September 28th 2018, 14:50:55.000       0.066       0.066   200     GET /myra/ HTTP/2.0         1
September 28th 2018, 14:31:57.000       0           0       200     GET /myra/ HTTP/1.1         1
September 28th 2018, 14:16:05.000       0           0       200     GET /myra/ HTTP/1.1         1

As you can see, $upstream_response_time logged as zero, in some messages.

antonbormotov
  • 1,821
  • 2
  • 20
  • 32
  • 1
    Are these requests served successfully? – miknik Sep 28 '18 at 15:10
  • Yes, the response is 200. Or, did you mean, it can be 200, but don't have any payload, something like white page? – antonbormotov Sep 28 '18 at 15:13
  • 1
    Does the request include the expected content? – miknik Sep 28 '18 at 15:15
  • Yes, it includes. – antonbormotov Sep 28 '18 at 15:27
  • 1
    Are failed requests passed to the next upstream server? Do you have any type of proxy caching? According to the Nginx docs for these variables _When a request is unable to reach an upstream server or a full header cannot be received, the variable contains “0” (zero)_ – miknik Sep 28 '18 at 15:33
  • Yes, failed requests are passed to the next upstream. We don't have proxy caching for these requests, for certain locations only, they are excluded from example above. These requests status codes are 200, it means they reached upstream. However, I'm not sure about part: full header cannot be received. – antonbormotov Oct 01 '18 at 09:23

0 Answers0