tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <>
Subject Re: CGI/HTML
Date Sun, 18 May 2008 01:21:05 GMT

"Christopher Schultz" <> wrote in message
> Hash: SHA1
> Shabu,
> Shabu Khan wrote:
> | For some reason, the cgi perl script that I run via IE/Firefox does not
> | render the output immediately,  but waits until it has big chunk of the
> | HTML.   Does this have anything to do with the tomcat/cgi setup or
> header or
> | something, or perl mod defaults?
> This probably has to do with the size of the output buffer in either
> Perl or whatever mechanism is being used to shuttle information from
> your CGI script through Tomcat and any other layers you may have in 
> between.
> I would check the CGI runner you are using to see if there is a buffer
> size tweaking setting.
> I didn't see anything like that in
> so you might want
> to check the code.
> CGIServlet appears to have a small (2048 byte) buffer for output, which
> shouldn't be a problem. It looks like the loop that monitors the
> (external) CGI process at 500ms intervals to check up on the process
> while no output is being produced. While output is being produced, it
> should be constantly moving data from the CGI's stdout to the
> ServletOutputStream (which is unbuffered). The /input/ from the CGI is

Not strictly true.  By default Tomcat has an 8Kb output buffer (in 
o.a.c.c.OutputBuffer ;) before actually sending the output to the Socket.

> buffered up through the end of the headers, and then the writer is
> ignored and the input stream is unbuffered (not really sure how this
> works properly...). It's possible that you are hitting odd buffer
> boundaries where a buffer flush requires several of these half-second
> pauses before enough data is available.
> Have you timed your perl script independently to see if there actually
> is a delay in generating the content, rather than simply moving if from
> the CGI to through Tomcat?
> - -chris
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla -
> pVMAnim65WeLxS4QfhfKyeeD207ECWfm
> =Pnob
> ---------------------------------------------------------------------
> To start a new topic, e-mail:
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message