in reply to CGI print statements taking forever

Unless evil gremlins abound (which would also make logical analysis pointless) it seems inconceivable that the print can in itself cause that much variation in performance. I would be inclined to look elsewhere, such as network issues. If it weren't for your timer evidence I'd have suspected multiple queueing for that db lock and even now it sort-of galls me to have to eliminate that - it seems oh-so credible as a suspect cause, given the "arithmetic" variation in performance measurements you report that suggest a per user cumulative delay - way tempting!

One world, one people

  • Comment on Re: CGI print statements taking forever

Replies are listed 'Best First'.
Re^2: CGI print statements taking forever
by traxlog (Scribe) on Jun 27, 2005 at 14:24 UTC
    Those evil gremlins are starting to look pretty suspicious!
    DB lock is of course now completely out of the question as is poor disk performance. That I isolated weeks ago.

    I don't know about the mechanics of the interaction between Perl and Apache, but is certainly perplexing why (given that it is a network issue) a client could hold back the successful execution of a cgi script. The internet would effectively grind to a halt if that were the case.

    I've read that Apache no longer buffers perl output since V1.2, leaving the Perl buffer as the only bottleneck, and like I said, $| = 1; and $| = 0; make no difference!

      Based on your additional info., my money is on it being the internet itself -- if output cannot be delivered even momentarily to the other end, you get a pause signal (used to be CTRL-S when I last looked into such things) coming back at some level which prevents the host continuing transmission until it gets a continue signal (used to be CTRL-Q the last time I looked). Such interaction takes place at a lower network layer than the Apache server is hooked into, but it might be possible to detect using some network administration tools. Or perhaps you could see if there is a correlation between distance to the user IP and print processing time?

      One world, one people