M
M
multifinger2012-06-22 17:17:14
PHP
multifinger, 2012-06-22 17:17:14

How to get rid of SIGBUS while running php-fpm?

Raised a web server with nginx + php-fpm + symfony1.4, scripts using MySQL, APC, Memcached
work. I test the server under load for a long time, I look at the logs:

Jun 22 17:54:13.793226 [WARNING] [pool www] child 27950 exited on signal 7 SIGBUS after 82.113882 seconds from start
Jun 22 17:54:13.793555 [NOTICE] [pool www] child 27978 started
Jun 22 17:57:05.123482 [WARNING] [pool www] child 27978 exited on signal 7 SIGBUS after 171.329932 seconds from start
Jun 22 17:57:05.123796 [NOTICE] [pool www] child 28069 started
Jun 22 17:59:56.901823 [WARNING] [pool www] child 28070 exited on signal 7 SIGBUS after 169.362491 seconds from start
Jun 22 17:59:56.902103 [NOTICE] [pool www] child 28105 started
Jun 22 18:03:03.044205 [WARNING] [pool www] child 28206 exited on signal 7 SIGBUS after 91.774054 seconds from start
Jun 22 18:03:03.044678 [NOTICE] [pool www] child 28226 started
Jun 22 18:03:57.233633 [WARNING] [pool www] child 28228 exited on signal 7 SIGBUS after 39.234232 seconds from start
Jun 22 18:03:57.233907 [NOTICE] [pool www] child 28235 started
Jun 22 18:04:30.170006 [WARNING] [pool www] child 28235 exited on signal 7 SIGBUS after 32.936104 seconds from start
Jun 22 18:04:30.170279 [NOTICE] [pool www] child 28253 started
Jun 22 18:05:25.752235 [WARNING] [pool www] child 28264 exited on signal 7 SIGBUS after 40.075326 seconds from start
Jun 22 18:05:25.752519 [NOTICE] [pool www] child 28339 started
Jun 22 18:07:55.575072 [WARNING] [pool www] child 28358 exited on signal 7 SIGBUS after 52.005688 seconds from start
Jun 22 18:07:55.575345 [NOTICE] [pool www] child 28365 started
Jun 22 18:09:17.171426 [WARNING] [pool www] child 28376 exited on signal 7 SIGBUS after 43.982024 seconds from start
Jun 22 18:09:17.171846 [NOTICE] [pool www] child 28403 started

Sometimes the web server, for some unknown reason, freezes altogether ...
Help me figure it out if anyone has come across this.
All necessary information, logs, etc. I will provide

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
multifinger, 2012-11-14
@multifinger

I found a solution, at least the performance has grown and SIGBUS is no longer found at all.
Firstly:

#/etc/php5/fpm/pool.d/www.conf
pm.max_children = 80 << 2000Mb (total_fpm_memory) / 25Mb (one fpm process memory usage)
pm.max_spare_servers = 20
pm.max_requests = 200

This generally improves stability, the parameters are calculated individually
in the same file, you can temporarily turn it on and see slow queries:

#slowlog = /var/log/php-fpm-slow.log
#request_slowlog_timeout = 5s
#listen.backlog = -1

Further:
#/etc/php5/conf.d/apc.ini
[APC]
extension=apc.so
apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 256
apc.optimization = 0
apc.num_files_hint = 10000
apc.user_entries_hint = 10000
apc.ttl=0
apc.user_ttl = 0
apc.gc_ttl=600
apc.cache_by_default = 1
apc.filters = "apc\.php$"
apc.slam_defense = 0
apc.use_request_time = 1
apc.mmap_file_mask = /tmp/apc.XXXXXX
apc.file_update_protection = 2
apc.enable_cli = 0
apc.max_file_size = 5M
<b>apc.stat = 0</b>
apc.write_lock = 1
apc.report_autofilter = 0
apc.include_once_override = 0
apc.rfc1867=0
apc.rfc1867_prefix="upload_"
apc.rfc1867_name = "APC_UPLOAD_PROGRESS"
apc.rfc1867_freq=0
apc.localcache = 1
apc.localcache.size = 512
apc.coredump_unmap = 0
apc.stat_ctime = 0

Here, in fact, only the apc.stat = 0 setting was the key, the rest can be thrown
away. Actually, it was the addition of apc.stat = 0 that allowed us to eliminate the SIGBUS error, now in the logs there are only notifications that child processes are restarted (due to pm.max_request)

N
NiGHt_LEshiY, 2012-06-22
@NiGHt_LEshiY

Try disabling caching (better start with APC) if possible and restart php.
There is a feeling that APC is to blame for climbing "in the wrong place" where it should be in terms of memory.

V
VBart, 2012-06-23
@VBart

Have you already tried updating?

A
Arvid Godyuk, 2012-06-26
@Psih

Have you configured error_log in php.ini? If not, turn it on, if yes, then see what's there. It is very similar to the fact that you do not have enough memory for the script.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question