title: nginx 502 Bad Gateway error. How large should my buffer be?
body: <p>I have a Nginx server which sole purpose is to read XML and to put it in a database.</p>
  
  <p>If the files are small, let's say 100MB everything works well. But If Im trying to <code>SimpleXMLELement</code> a file of around 700MB I get a 502 Bad Gateway warning.</p>
  
  <p>I read up on the problem and fiddled with the settings below, but it didnt help yet. Should my buffers be larger? As in: 700M or something?</p>
  
  <p>nginx.conf (in http{}):</p>
  
  <pre><code>fastcgi_buffers 128 128k;
  fastcgi_buffer_size 128k;
  fastcgi_connect_timeout 3000;
  fastcgi_send_timeout 3000;
  fastcgi_read_timeout 3000;
  </code></pre>
  
  <p>I have <code>ini_set("memory_limit", "-1");</code> in my php script and <code>php_admin_value[memory_limit] = 2042M</code> in php-fpm.conf</p>
  
  <pre><code>[03-Jul-2015 11:53:44] WARNING: [pool www] child 6327 exited on signal 9 (SIGKILL) after 19.047513 seconds from start
  [03-Jul-2015 12:16:12] WARNING: [pool www] child 6518 exited on signal 9 (SIGKILL) after 23.669892 seconds from start
  [03-Jul-2015 12:22:13] NOTICE: configuration file /opt/nginxstack-1.8.0-0/php/etc/php-fpm.conf test is successful
  
  [03-Jul-2015 12:23:35] WARNING: [pool www] child 7089 exited on signal 9 (SIGKILL) after 23.245077 seconds from start
  </code></pre>
  
  <p>(After changes I restart the server).</p>