Welcome! Log In Create A New Profile

Advanced

Re: Fastcgi_cache sometimes returns statuscode 500

Maxim Dounin
March 02, 2015 07:48AM
Hello!

On Mon, Mar 02, 2015 at 06:11:24AM -0500, mastercan wrote:

> 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?

Try looking into the error log. When nginx returns 500, it used to
complain to the error log explaining the reason.

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
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: 323
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