Welcome! Log In Create A New Profile

Advanced

Fastcgi_cache sometimes returns statuscode 500

March 02, 2015 06:11AM
Hello,

Nginx (all versions since September 2014, but at least 1.7.9, 1.7.10) sometimes returns HTTP status code 500, when serving pages from fastcgi_cache.

Each time this happens, following conditions hold true:
*) $upstream_cache_status = HIT (so we don't even hit php-fpm)
*) $body_bytes_sent = 0 (which is strange, because I've got an error page defined for http code 500, that is obviously not sent)

I've configured an error page for status code 500 which is correctly shown on errors from PHP - this was tested for status code 503.
Nginx seems to have a bug here, I guess? Why would it otherwise return a zero bytes size body?

This happens for about 30-40 requests a day. All other requests (several thousand) are correctly returning status code 200. Server load/CPU load is very low...

I've configured fastcgi cache as follows:
fastcgi_cache_path /dev/shm/ngxcache levels=1:2 use_temp_path=off keys_zone=MYSITE:5M max_size=50M inactive=2h;

Maybe somebody knows advice?

br,
mastercan
Subject Author Posted

Fastcgi_cache sometimes returns statuscode 500

mastercan March 02, 2015 06:11AM

Re: Fastcgi_cache sometimes returns statuscode 500

Maxim Dounin March 02, 2015 07:48AM

Re: Fastcgi_cache sometimes returns statuscode 500

mastercan March 02, 2015 07:50AM

Re: Fastcgi_cache sometimes returns statuscode 500

Maxim Dounin March 02, 2015 07:58AM

Re: Fastcgi_cache sometimes returns statuscode 500

mastercan March 02, 2015 08:04AM

Re: Fastcgi_cache sometimes returns statuscode 500

mastercan March 02, 2015 09:11AM

Re: Fastcgi_cache sometimes returns statuscode 500

Maxim Dounin March 02, 2015 10:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 93
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready