title: php-fpm child process exited on signal 11
body: <p>Our application runs in a Docker container on AWS:</p>
  <ul>
  <li>Operating system: <a href="https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_14.04_LTS_.28Trusty_Tahr.29" rel="nofollow noreferrer">Ubuntu 14.04.2</a> LTS (Trusty Tahr)</li>
  <li><a href="https://en.wikipedia.org/wiki/Nginx" rel="nofollow noreferrer">Nginx</a> version: nginx/1.4.6 (Ubuntu)</li>
  <li><a href="https://en.wikipedia.org/wiki/Memcached" rel="nofollow noreferrer">Memcached</a> version: memcached 1.4.14</li>
  <li>PHP version: PHP 5.5.9-1ubuntu4.11 (cli) (built: Jul 2 2015 15:23:08)</li>
  <li>System Memory: 7.5 GB</li>
  </ul>
  <p>We get blank pages and a <em>404 Error</em> less frequently. While checking the logs, I found that the <em>php-child</em> process is killed and it seems that memory is mostly used by memcache and php-fpm process and very low free memory.</p>
  <p>memcache is configured to use 2 GB memory.</p>
  <p>Here is php www.conf</p>
  <pre><code>pm = dynamic
  pm.max_children = 30
  pm.start_servers = 9
  pm.min_spare_servers = 4
  pm.max_spare_servers = 14
  rlimit_files = 131072
  rlimit_core = unlimited
  </code></pre>
  <h3>Error logs</h3>
  <pre><code>/var/log/nginx/php5-fpm.log
  [29-Jul-2015 14:37:09] WARNING: [pool www] child 259 exited on signal 11 (SIGSEGV - core dumped) after 1339.412219 seconds from start
  
  /var/log/nginx/error.log
  
  2015/07/29 14:37:09 [error] 141#0: *2810 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: x.x.x.x, server: _, request: &quot;GET /suggestions/business?q=Selectfrom HTTP/1.1&quot;, upstream: &quot;fastcgi://127.0.0.1:9000&quot;, host: &quot;example.com&quot;, referrer: &quot;http://example.com/&quot;
  
  /var/log/nginx/php5-fpm.log
  [29-Jul-2015 14:37:09] NOTICE: [pool www] child 375 started
  
  
  /var/log/nginx/php5-fpm.log:[29-Jul-2015 14:37:56] WARNING: [pool www] child 290 exited on signal 11 (SIGSEGV - core dumped) after 1078.606356 seconds from start
  </code></pre>
  <h3>Coredump</h3>
  <pre><code>Core was generated by php-fpm: pool www.Program terminated with signal SIGSEGV, Segmentation fault.#0  0x00007f41ccaea13a in memcached_io_readline(memcached_server_st*, char*, unsigned long, unsigned long&amp;) () from /usr/lib/x86_64-linux-gnu/libmemcached.so.10
  </code></pre>
  <p>dmesg</p>
  <pre><code>[Wed Jul 29 14:26:15 2015] php5-fpm[12193]: segfault at 7f41c9e8e2da ip 00007f41ccaea13a sp 00007ffcc5730ce0 error 4 in libmemcached.so.10.0.0[7f41ccad2000+32000]
  [Wed Jul 29 14:28:26 2015] php5-fpm[12211]: segfault at 7f41c966b2da ip 00007f41ccaea13a sp 00007ffcc5730ce0 error 4 in libmemcached.so.10.0.0[7f41ccad2000+32000]
  [Wed Jul 29 14:29:16 2015] php5-fpm[12371]: segfault at 7f41c9e972da ip 00007f41ccaea13a sp 00007ffcc5730b70 error 4 in libmemcached.so.10.0.0[7f41ccad2000+32000]
  [Wed Jul 29 14:35:36 2015] php5-fpm[12469]: segfault at 7f41c96961e9 ip 00007f41ccaea13a sp 00007ffcc5730ce0 error 4 in libmemcached.so.10.0.0[7f41ccad2000+32000]
  [Wed Jul 29 14:35:43 2015] php5-fpm[12142]: segfault at 7f41c9e6c2bd ip 00007f41ccaea13a sp 00007ffcc5730b70 error 4 in libmemcached.so.10.0.0[7f41ccad2000+32000]
  [Wed Jul 29 14:37:07 2015] php5-fpm[11917]: segfault at 7f41c9dd22bd ip 00007f41ccaea13a sp 00007ffcc5730ce0 error 4 in libmemcached.so.10.0.0[7f41ccad2000+32000]
  [Wed Jul 29 14:37:54 2015] php5-fpm[12083]: segfault at 7f41c9db72bd ip 00007f41ccaea13a sp 00007ffcc5730ce0 error 4 in libmemcached.so.10.0.0[7f41ccad2000+32000]
  </code></pre>