If you're not using it already, you should definitely get quite familiar with looking at the file generated by the input_log($fileName) method. This allows you to see what happens to a session. You can see what the program had seen at the point where it timed out. I found that often, what I thought the program was waiting on was not what it was actually waiting on.
Good luck. It's a maddenly tricky way to get data, but when it's the only way, it does beat the alternatives.