Re: Flushing
Oskar wrote: Hi, I have script that is doing some time consuming operations hence have set $|=1 to disable buffering. It works correctly in command line but when I run it as cgi it does buffers everything and flushing does not work. After reaching timeout limit it displays server error. I have apache 1.3 Does anyone here has suggestion how to prevent it (other then increasing the timeout limit because it then returns 404 to client)? http://perl.apache.org/docs/1.0/guide/performance.html#Using1_Under_mod_perl_and_Better_print___Techniques_ __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Flushing
Hello there, On Sun, 6 Jul 2003, Oskar wrote: > I have script that is doing some time consuming operations This has been discussed many times on the List, check the archives. 73, Ged.
Flushing
Hi, I have script that is doing some time consuming operations hence have set $|=1 to disable buffering. It works correctly in command line but when I run it as cgi it does buffers everything and flushing does not work. After reaching timeout limit it displays server error. I have apache 1.3 Does anyone here has suggestion how to prevent it (other then increasing the timeout limit because it then returns 404 to client)? Thanks Oskar
RE: flushing appears to be broken with perl 5.6.0
Stas, I am printing 4k of data for each push .. # this to flush buffer of front end proxy-server. my $new_line = "\n" x 4096; print $new_line; (make sure gzip filter if off ...) http://forum.swarthmore.edu/epigone/modperl/kerdsnestim/14702.7611.496757.13 [EMAIL PROTECTED] I am sure there are some other more efficient solutions which I don't know, but would like to know. -Niraj -Original Message- From: Stas Bekman [mailto:[EMAIL PROTECTED]] Sent: Monday, January 08, 2001 11:18 AM To: mod_perl list Subject: Re: flushing appears to be broken with perl 5.6.0 On Mon, 8 Jan 2001, Stas Bekman wrote: > Hi, > > This simple Apache::Registry script is supposed to print the PID and then > hang, it used to work with older mod_perl/perl versions, it doesn't print > the PID now -- rflush doesn't seem to work. (neither $|=1 works) > > my $r = shift; > $r->send_http_header('text/plain'); > > $r->print("PID = $$\n"); > $r->rflush; > > while(1){ > sleep 1; > } > > I've tested it with mod_perl-1.24_(01|02)/apache-1.3.14 and > mod_perl-1.24/apache-1.3.12 with perl 5.6.0 (running on Linux). > > Has it something to do with bugs in 5.6.0? If you have the patched version > of 5.6.0 can you please test it? As pointed out by Niraj Sheth in the private reply I had a problem with front-end buffering. Accessing the back-end server directly solves the problem. Which leads to a question, on how to make the real flush. Currently rflush and ($|=1) are quite useless if there is a buffering process at the front end side. Thanks. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://logilune.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: flushing appears to be broken with perl 5.6.0
On Mon, 8 Jan 2001, Stas Bekman wrote: > Hi, > > This simple Apache::Registry script is supposed to print the PID and then > hang, it used to work with older mod_perl/perl versions, it doesn't print > the PID now -- rflush doesn't seem to work. (neither $|=1 works) > > my $r = shift; > $r->send_http_header('text/plain'); > > $r->print("PID = $$\n"); > $r->rflush; > > while(1){ > sleep 1; > } > > I've tested it with mod_perl-1.24_(01|02)/apache-1.3.14 and > mod_perl-1.24/apache-1.3.12 with perl 5.6.0 (running on Linux). > > Has it something to do with bugs in 5.6.0? If you have the patched version > of 5.6.0 can you please test it? As pointed out by Niraj Sheth in the private reply I had a problem with front-end buffering. Accessing the back-end server directly solves the problem. Which leads to a question, on how to make the real flush. Currently rflush and ($|=1) are quite useless if there is a buffering process at the front end side. Thanks. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://logilune.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
flushing appears to be broken with perl 5.6.0
Hi, This simple Apache::Registry script is supposed to print the PID and then hang, it used to work with older mod_perl/perl versions, it doesn't print the PID now -- rflush doesn't seem to work. (neither $|=1 works) my $r = shift; $r->send_http_header('text/plain'); $r->print("PID = $$\n"); $r->rflush; while(1){ sleep 1; } I've tested it with mod_perl-1.24_(01|02)/apache-1.3.14 and mod_perl-1.24/apache-1.3.12 with perl 5.6.0 (running on Linux). Has it something to do with bugs in 5.6.0? If you have the patched version of 5.6.0 can you please test it? Thanks. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://logilune.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: Flushing handler getting Open Sourced...
This is the place. =) Submit a proposal for how you think PerlRun should change, and get people to discuss it so you can settle on something that seems good. Then submit a patch, preferably against the CVS version. [EMAIL PROTECTED] (Andrew Chen) wrote: >Yeah, that sounds about right... It's not at either extreme-- it doesn't >keep EVERYTHING, and it doesn't kill the Apache child to clear the memory. >I'm sure the exact directives can be thought out later. > >So who do I get in touch with in order for this stuff to get looked at for >inclusion into mod_perl? > >Andrew Chen >Intern, Architecture >[EMAIL PROTECTED] >206-219-8445 >The Cobalt Group, Inc. > >On Tue, 8 Aug 2000, Ken Williams wrote: > >> [EMAIL PROTECTED] (Andrew Chen) wrote: >> >Hello all, >> > >> >I was involved in a discussion a few weeks ago regarding how Cobalt Group >> >(www.cobaltgroup.com) could get a performance boost by running our very >> >very dirty modules under PerlRun with PerlRunOnce Off and then to have a >> >handler that cleaned up between requests. >> > >> >Anyway, with a lot of help from the mod_perl community (thanks guys!) the >> >handler was written, and it is currently going through QA to push this out >> >to all of our websites (many thousands). >> >> Holy ambition! >> >> >Additionally, we are going to release this back into the community for >> >those that, like us, are unlucky enough to have dirty code that would be >> >too expensive to rewrite. >> > >> >The question is now: >> > How should we do it? >> > >> >1) Should it be integrated into the mod_perl package? >> >2) Should it be a seperate package in CPAN? >> >3) etc., etc. >> >> It's quite possible that some of your functionality should get >> integrated into PerlRun itself. It sounds like an intermediate setting >> between PerlRunOnce Off and PerlRunOnce On. What about a setting like >> >> PerlSetVar PerlRunMode Once(equivalent to PerlRunOnce On) >> PerlSetVar PerlRunMode Cleanup (adds your cleanup stuff) >> PerlSetVar PerlRunMode Trust (equivalent to PerlRunOnce Off) >> >> The 'Trust' name is pretty stupid, couldn't think of anything better >> right now. Anyway, would something like this make sense? Or perhaps a >> "PerlRunCleanup" directive? >> >> >> > >
Re: Flushing handler getting Open Sourced...
Yeah, that sounds about right... It's not at either extreme-- it doesn't keep EVERYTHING, and it doesn't kill the Apache child to clear the memory. I'm sure the exact directives can be thought out later. So who do I get in touch with in order for this stuff to get looked at for inclusion into mod_perl? Andrew Chen Intern, Architecture [EMAIL PROTECTED] 206-219-8445 The Cobalt Group, Inc. On Tue, 8 Aug 2000, Ken Williams wrote: > [EMAIL PROTECTED] (Andrew Chen) wrote: > >Hello all, > > > >I was involved in a discussion a few weeks ago regarding how Cobalt Group > >(www.cobaltgroup.com) could get a performance boost by running our very > >very dirty modules under PerlRun with PerlRunOnce Off and then to have a > >handler that cleaned up between requests. > > > >Anyway, with a lot of help from the mod_perl community (thanks guys!) the > >handler was written, and it is currently going through QA to push this out > >to all of our websites (many thousands). > > Holy ambition! > > >Additionally, we are going to release this back into the community for > >those that, like us, are unlucky enough to have dirty code that would be > >too expensive to rewrite. > > > >The question is now: > > How should we do it? > > > >1) Should it be integrated into the mod_perl package? > >2) Should it be a seperate package in CPAN? > >3) etc., etc. > > It's quite possible that some of your functionality should get > integrated into PerlRun itself. It sounds like an intermediate setting > between PerlRunOnce Off and PerlRunOnce On. What about a setting like > > PerlSetVar PerlRunMode Once(equivalent to PerlRunOnce On) > PerlSetVar PerlRunMode Cleanup (adds your cleanup stuff) > PerlSetVar PerlRunMode Trust (equivalent to PerlRunOnce Off) > > The 'Trust' name is pretty stupid, couldn't think of anything better > right now. Anyway, would something like this make sense? Or perhaps a > "PerlRunCleanup" directive? > > >
Re: Flushing handler getting Open Sourced...
[EMAIL PROTECTED] (Andrew Chen) wrote: >Hello all, > >I was involved in a discussion a few weeks ago regarding how Cobalt Group >(www.cobaltgroup.com) could get a performance boost by running our very >very dirty modules under PerlRun with PerlRunOnce Off and then to have a >handler that cleaned up between requests. > >Anyway, with a lot of help from the mod_perl community (thanks guys!) the >handler was written, and it is currently going through QA to push this out >to all of our websites (many thousands). Holy ambition! >Additionally, we are going to release this back into the community for >those that, like us, are unlucky enough to have dirty code that would be >too expensive to rewrite. > >The question is now: > How should we do it? > >1) Should it be integrated into the mod_perl package? >2) Should it be a seperate package in CPAN? >3) etc., etc. It's quite possible that some of your functionality should get integrated into PerlRun itself. It sounds like an intermediate setting between PerlRunOnce Off and PerlRunOnce On. What about a setting like PerlSetVar PerlRunMode Once(equivalent to PerlRunOnce On) PerlSetVar PerlRunMode Cleanup (adds your cleanup stuff) PerlSetVar PerlRunMode Trust (equivalent to PerlRunOnce Off) The 'Trust' name is pretty stupid, couldn't think of anything better right now. Anyway, would something like this make sense? Or perhaps a "PerlRunCleanup" directive?
Flushing handler getting Open Sourced...
Hello all, I was involved in a discussion a few weeks ago regarding how Cobalt Group (www.cobaltgroup.com) could get a performance boost by running our very very dirty modules under PerlRun with PerlRunOnce Off and then to have a handler that cleaned up between requests. Anyway, with a lot of help from the mod_perl community (thanks guys!) the handler was written, and it is currently going through QA to push this out to all of our websites (many thousands). Additionally, we are going to release this back into the community for those that, like us, are unlucky enough to have dirty code that would be too expensive to rewrite. The question is now: How should we do it? 1) Should it be integrated into the mod_perl package? 2) Should it be a seperate package in CPAN? 3) etc., etc. Anyway, if anyone has an idea of what the best way to go about this would be, that would be great. Thanks! Andrew Chen Intern, Architecture [EMAIL PROTECTED] 206-219-8445 The Cobalt Group, Inc.