You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Peter Mayr <ma...@info.fh-eisenstadt.ac.at> on 2001/09/25 17:31:43 UTC

stopping EMB:PERL

 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi,

first of all thanks and praises for this wonderful tool, I am
currently creating a website as part of a workplacement and emb:perl
is great for the use within templates...


however emb:perl caused me some distress recently:
I tried a to acceass a mysql database and had an error in my sql
statement but the problem was that I appearantly couldn't stop
emb:perl.
the apache error_log was growing and growing although I had
interrupted the connection (the stop button on the browser..)
I grew kindof desperate and even moved the file that was executed to
another location (honestly I don't know if that even makes sense) but
not even that stopped it.
and the diskspace was becoming fewer and fewer

the solution in the end was to stop httpd

I searched the documentation on the emb:perl website
the only thing I found was
"Under perl5.004 there are memory leaks. This is not an Embperl bug,
but can cause your httpd to grow endlessly when running under
mod_perl. Please upgrade to perl5.004_04 to fix this. You should also
upgrade to a mod_perl version higher than 1.07_01 as soon as
possible, because until 1.07_01 there is a memory leak in
Apache->push_handler."
the version of mod_perl is 1.25 and the perl version 5.6 meaning
above the ones mentioned in this paragraph

the thing is I am not a programmer so please excuse me if I may not
have described the problem very accurately but if anyone coud give me
a clue what happenened and what is possible to avoid such situations
I would be most grateful

thanks in advance

peter

ps. some additional info maybe it's helpful...
the machine was a red hat 6.0 linux box with a 2.2.5-15 kernel
- -------------------------------------
PGP Public Key may be downloaded at:
http://www.infofreak.at/PeterMayr.asc
- -------------------------------------


-----BEGIN PGP SIGNATURE-----
Version: PGP 7.0.4

iQA/AwUBO7CjXlQyF72FK9dGEQLDwwCfdfDu1XSfoAqzTGlhuPm0GEmHa5sAnim2
ckUQkhbPqI7M2MPOp3fhoz/T
=gsB1
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: stopping EMB:PERL

Posted by Wim Kerkhoff <wi...@merilus.com>.
Gerald Richter wrote:
> 
> >
> > that a sql statement couldn't be executed (I had an error in my sql
> > syntax a ';'),
> 
> Maybe this has triggered an endless loop in your Perl code. An endless loop
> will not be stopped by Embperl (because it can't detected it), Apache has a
> timeout, which is 10 minutes per default, after that it should stop the
> request (but I never have tried if it really does).

I've had this several times... I learned that doing

[$ while (@stuff = $sth->fetchrow-array) $]

Will kill a server (100% CPU, 100% memory, 100% swap) in seconds. (The
'-' should be a '_'.)

> The easiest way to stop such a request is to kill the corresponding Apache
> child process (if you running Unix, on Windows you can only restart the
> server). Simply run top, see which child consumes your cpu time and kill it.

Which works when you have superuser access :P


Wim

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: stopping EMB:PERL

Posted by Gerald Richter <ri...@ecos.de>.
>
> that a sql statement couldn't be executed (I had an error in my sql
> syntax a ';'),

Maybe this has triggered an endless loop in your Perl code. An endless loop
will not be stopped by Embperl (because it can't detected it), Apache has a
timeout, which is 10 minutes per default, after that it should stop the
request (but I never have tried if it really does).

The easiest way to stop such a request is to kill the corresponding Apache
child process (if you running Unix, on Windows you can only restart the
server). Simply run top, see which child consumes your cpu time and kill it.

> rather normal stuff I also tied a die statement to the
> execute and prepare function to be on the safe side but it seems that
> die wasn't executed
>

In Embperl 1.x die only terminates the block in which it occurs, all other
blocks will still run. So in case of an endless loop (if the loop in in
another block) the script will still continue. Use exit to terminate the
execution of the whole page.

This behaviour is changed in Embperl 2.0, where die really terminates the
whole page, which is what most users expect it to do.

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: stopping EMB:PERL

Posted by Peter Mayr <ma...@info.fh-eisenstadt.ac.at>.
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



 
> On Tue, Sep 25, 2001 at 04:31:43PM +0100, Peter Mayr wrote:
> > I tried a to acceass a mysql database and had an error in my sql
> > statement but the problem was that I appearantly couldn't stop
> > emb:perl.
> > the apache error_log was growing and growing although I had
> > interrupted the connection (the stop button on the browser..)
> 
> what were the error_log error messages ?

that a sql statement couldn't be executed (I had an error in my sql
syntax a ';'), rather normal stuff I also tied a die statement to the
execute and prepare function to be on the safe side but it seems that
die wasn't executed

peter

-----BEGIN PGP SIGNATURE-----
Version: PGP 7.0.4

iQA/AwUBO7GLXlQyF72FK9dGEQLlAgCg6IT7/owhPLFJZT6ilNcqbeUUiaUAoOuX
oec9mX19BEMWhbUCKe430g/K
=k0VQ
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: stopping EMB:PERL

Posted by Angus Lees <gu...@switchonline.com.au>.
On Tue, Sep 25, 2001 at 04:31:43PM +0100, Peter Mayr wrote:
> I tried a to acceass a mysql database and had an error in my sql
> statement but the problem was that I appearantly couldn't stop
> emb:perl.
> the apache error_log was growing and growing although I had
> interrupted the connection (the stop button on the browser..)

what were the error_log error messages ?

-- 
 - Gus

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org