title: performance implications of php output buffering with Apache and MySQL
body: <p>I am a bit confused about how php buffering works. </p>
  
  <p>Let's say you have a php page <code>foo.php</code> and <code>output_buffering = 4096</code> in <code>php.ini</code>, and Apache receives a get request for <code>foo.php</code>. <code>foo.php</code> starts executing, and as soon as 4096 bytes are ready, they are sent to Apache. Apache starts sending those 4096 bytes to the client.  </p>
  
  <p>Here's what I don't understand: what happens when there's a some nasty tracker callout, a javascript or an image that was sent to the browser. The browser gets hung up and is not talking back to Apache for a while, holding it up. Apache is not releasing MySQL thread, which is showing up as a "sleeper". Is this correct or am I completely off base here?</p>