Peter Zaitsev posted a very interesting test on how PHP and Apache handle runaway PHP scripts.
I’m sure all of us have had a long executing SQL script or at least a runaway script, and he points out even with
ignore_user_abort set to FALSE and max execution times set both in PHP and Apache, a runaway SQL query can execute beyond the timeouts, even when aborted by the user (stop button on the browser).
Even using the function
connection_aborted() to check for a user abort fails.
However, the script will cease on a user abort if it performs regular
ob_flush(); flush(); commands. For example:
Just one more reason why I love the MySql Performance Blog.