Try posting the query or posting some more details about it. You said it tracks traffic is it mostly inserts?
Try to find the exact spot the page times out. ie comment out the query does the page work?
Put $start = microtime( ); right before the query and right after the query
$end = microtime( );
echo $end - $start;
to see exactly how long the query takes (if it finishes at all)
I was once told (don't know if this is true) that you could call a script through an image tag which would be a seperate request and not slow the load time of the calling page.
Calling page:
<img src="image.php" width="1" height="1" alt=""/>
Image.php
<?
Header("Content-Type: image/gif");
include("sql_query.php");
echo base64_decode("R01GOD1HAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEOw==");
?>
It makes sense in theory since from the browser's point of view it's just an image that's taking a long time to load so it will give up on it at a certain point. Still doesn't garantee the script finishes executing but it should "crash nicely" :queasy: Or just make the image the first thing the browser tries to grab.