502 Gateway Timeout with error exited on signal 7 (SIGBUS) after clearing cache (nginx with php5-fpm

Hello,

i’ve got the problem when i load a page multiple times (i.E. 10 Tabs
with
autoreload) only some of the pages load others get 502. it doesn’t
depend on
the content of the page. when i open the same page in all tabs it’s the
same
situation. about 3 out of 10 get 502 errors.
The 502 Error comes direct when i force the autoload for all pages, so
there
is no timeout causing the error because it only takes less that a second
to
give the 502. I reconized that this only happens when the cache is
cleared
in the cms and needs a rebuild on pageload. if the page is cached i
don’t
get any 502 errors anymore. When i disable the caching in modx backend i
get
the same errors like manual clearing the cache.

installed on a openVZ VPS with 24GB Ram and 12 Cores also tested on a
physical machine with 32GB ram and 8 cores. both managed with
ISPconfig3.

PHP 5.4.39-1~dotdeb.1 (fpm-fcgi) (built: Mar 22 2015 08:08:54)
nginx/1.6.2
mysql

The Page is done with Modx CMS Framework 2.3.3

Error Log:
2015/03/26 00:09:16 [error] 27345#0: *231 recv() failed (104: Connection
reset by peer) while reading response header from upstream, client:
178.203.23.132, ser$
2015/03/26 00:09:16 [error] 27345#0: *229 recv() failed (104: Connection
reset by peer) while reading response header from upstream, client:
178.203.23.132, ser$
2015/03/26 00:09:16 [error] 27345#0: *234 recv() failed (104: Connection
reset by peer) while reading response header from upstream, client:
178.203.23.132, ser$

PHP-FPM log
[25-Mar-2015 23:54:30.875237] DEBUG: pid 28694,
fpm_pctl_perform_idle_server_maintenance(), line 362: [pool web91]
currently
0 active children, 6 spare children
[25-Mar-2015 23:54:30.875247] DEBUG: pid 28694,
fpm_pctl_perform_idle_server_maintenance(), line 379: [pool web32]
currently
0 active children, 2 spare children, 2 running children. Spawning rate 1
[25-Mar-2015 23:54:30.875257] DEBUG: pid 28694,
fpm_pctl_perform_idle_server_maintenance(), line 379: [pool apps]
currently
0 active children, 2 spare children,
2 running children. Spawning rate 1
[25-Mar-2015 23:54:31.398167] DEBUG: pid 28694, fpm_event_loop(), line
419:
event module triggered 1 events
[25-Mar-2015 23:54:31.487717] DEBUG: pid 28694, fpm_got_signal(), line
76:
received SIGCHLD
[25-Mar-2015 23:54:31.487757] WARNING: pid 28694, fpm_children_bury(),
line
252: [pool web91] child 28735 exited on signal 7 (SIGBUS) after
57.721563
seconds from start
[25-Mar-2015 23:54:31.490246] NOTICE: pid 28694, fpm_children_make(),
line
421: [pool web91] child 28783 started
[25-Mar-2015 23:54:31.490269] DEBUG: pid 28694, fpm_event_loop(), line
419:
event module triggered 1 events
[25-Mar-2015 23:54:31.587862] DEBUG: pid 28694, fpm_got_signal(), line
76:
received SIGCHLD
[25-Mar-2015 23:54:31.587906] WARNING: pid 28694, fpm_children_bury(),
line
252: [pool web91] child 28740 exited on signal 7 (SIGBUS) after
47.234370
seconds from start
[25-Mar-2015 23:54:31.590430] NOTICE: pid 28694, fpm_children_make(),
line
421: [pool web91] child 28784 started
[25-Mar-2015 23:54:31.590460] WARNING: pid 28694, fpm_children_bury(),
line
252: [pool web91] child 28741 exited on signal 7 (SIGBUS) after
42.284682
seconds from start

nginx.conf
tcp_nopush on;
tcp_nodelay on;
types_hash_max_size 2048;
server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
server_tokens off;
sendfile on;
keepalive_timeout 65;
charset utf-8;
client_max_body_size 64m;
client_body_buffer_size 128k;
client_body_timeout 300s;
large_client_header_buffers 4 16k;
server_names_hash_bucket_size 512;
server_names_hash_max_size 2048;
fastcgi_buffers 256 16k;
fastcgi_buffer_size 128k;
fastcgi_read_timeout 5m;
fastcgi_max_temp_file_size 0;

php-fpm.conf
emergency_restart_threshold = 60
emergency_restart_interval = 1m
process_control_timeout = 60s
rlimit_files = 65536
rlimit_core = unlimited

anyone got a idea where to look for the source of the problem

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,257732,257732#msg-257732

installed on a openVZ VPS with 24GB Ram and 12 Cores also tested on a
physical machine with 32GB ram and 8 cores. both managed with ISPconfig3.

PHP 5.4.39-1~dotdeb.1 (fpm-fcgi) (built: Mar 22 2015 08:08:54)
nginx/1.6.2
mysql

PHP crashes, report the problem to whoever is providing support for this
dotdeb package or install the proper package from your distribution.

Debian stable ships PHP 5.4.39, it doesn’t make any sense to use dotdeb.

Lukas T. Wrote:

this
dotdeb package or install the proper package from your distribution.

Debian stable ships PHP 5.4.39, it doesn’t make any sense to use
dotdeb.

i’ve gemoved the dotdeb php package and installed the php that is
shipped by
debian.

PHP 5.4.39-0+deb7u2 (fpm-fcgi) (built: Mar 25 2015 08:35:25)
Copyright © 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright © 1998-2014 Zend Technologies

still the same result:
[29-Mar-2015 15:13:55.673640] DEBUG: pid 29675, fpm_got_signal(), line
76:
received SIGCHLD
[29-Mar-2015 15:13:55.673690] WARNING: pid 29675, fpm_children_bury(),
line
252: [pool web92] child 29711 exited on signal 7 (SIGBUS) after
169.674900
seconds from start
[29-Mar-2015 15:13:55.674695] NOTICE: pid 29675, fpm_children_make(),
line
421: [pool web92] child 29859 started
[29-Mar-2015 15:13:55.674734] DEBUG: pid 29675, fpm_event_loop(), line
419:
event module triggered 1 events
[29-Mar-2015 15:13:55.715464] DEBUG: pid 29675, fpm_got_signal(), line
76:
received SIGCHLD
[29-Mar-2015 15:13:55.715498] WARNING: pid 29675, fpm_children_bury(),
line
252: [pool web92] child 29779 exited on signal 7 (SIGBUS) after
102.643864
seconds from start
[29-Mar-2015 15:13:55.716048] NOTICE: pid 29675, fpm_children_make(),
line
421: [pool web92] child 29860 started
[29-Mar-2015 15:13:55.716063] DEBUG: pid 29675, fpm_event_loop(), line
419:
event module triggered 1 events
[29-Mar-2015 15:13:56.181544] DEBUG: pid 29675,
fpm_pctl_perform_idle_server_maintenance(), line 379: [pool web92]
currently
5 active children, 0 spare children, 5 running children. Spawning rate 1

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,257732,257734#msg-257734

As Lukas rightly pointed it out, you are definitely at a wrong location
to
seek help for PHP-FPM.

SIGBUS indicates a problem with the way the worker deals with memory. It
is
highly likely this is caused by some faulty module.
http://serverfault.com/a/474725

One the names which immediately comes to my mind is APC.
Try to start PHP-FPM by removing as much extensions as possible, and if
you
use APC, think about replacing it with APCu (user data cache) and Zend
OPcache (opcode cache).

If this does not help, please ask PHP-FPM-related communities.

B. R.

Debian stable ships PHP 5.4.39, it doesn’t make any sense to use
dotdeb.

i’ve gemoved the dotdeb php package and installed the php that is shipped by
debian.

Get a coredump and open a debian bug with the backtrace, here’s how to
do it:
https://rtcamp.com/tutorials/php/core-dump-php5-fpm/

Although I’m not sure if this works in a openvz container …

Anyway, its not an nginx problem, you would be better of talking to
php people.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs