Thanks Chris. I don't see any 'buffer setting tweaks' in the code, from the command line there is no delay it works just like a regular perl/shell script.
This is a code written by someone back in 2000, I ported it to Perl 5.8.5 from Perl 5.005 and to the new Kernel (Linux 2.6), the output shows-up on the browser only after the code is executed completely (basically after the script run is complete). Earlier with Apache, I was able to see the output as it ran, just like from the command line on the browser ... On Fri, May 16, 2008 at 10:43 AM, Christopher Schultz < [EMAIL PROTECTED]> wrote: > -----BEGIN PGP SIGNED 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 > http://tomcat.apache.org/tomcat-6.0-doc/cgi-howto.html 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 > 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 > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkgtx7EACgkQ9CaO5/Lv0PB4CACggNXDgd1RVziRT+L9KEFr60nC > pVMAnim65WeLxS4QfhfKyeeD207ECWfm > =Pnob > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Shabu Khan | Mentis Systems Inc | W: (425) 649-1130 | C: (425) 301-1948 | F: (425) 256-2819 http://www.linkedin.com/in/shabukhan