You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Bill Moseley <mo...@hank.org> on 2000/10/12 19:28:56 UTC

Spinning httpd

I'm in need of some ideas!

I have a spinning mod_perl process.  I installed a

  $SIG{USR2} = \&Carp::confess;

handler and it pointed to this line:

   $cnt++ while $query->{query} =~ /(?:^|\s)[("]*\S$size\*/g;

which was suppose to count how many wildcards (words ending with '*') of a
given length were in the query.

So I changed it to this to see if that would help:

   while ( $query->{query} =~ /(?:^|\s)[("]*(\S+)\*/g ) {
       $wilds{ length $1 }++;
   }

But it still spins and kill -USR2 reports that new line.

On the production machine (Sun 5.6) I can spin the process any time I try a
request with a wild card "*".  Taking the httpd.conf and just changing the
port number I've been able to make it spin only once after many many
attempts.  I have not been able to make it happen on my development
machine, but it's running perl 5.6 instead of 5.00503.  Mod_perl 1.24 of
course.

Any idea on how to find out the reason for the spinning (if I can make it
happen again)?

I had a similar problem with a regexp spinning about a year ago running on
5.005_02 on this same machine that was fixed by upgrading to the currently
running 5.005_03.  
  see: http://x66.deja.com/viewthread.xp?AN=557820602




Bill Moseley
mailto:moseley@hank.org

Re: Spinning httpd

Posted by Bill Moseley <mo...@hank.org>.
At 07:45 PM 10/12/00 +0200, Robin Berjon wrote:
>At 10:28 12/10/2000 -0700, Bill Moseley wrote:
>>I have a spinning mod_perl process.  I installed a
>>  $SIG{USR2} = \&Carp::confess;
>>handler and it pointed to this line:
>>   $cnt++ while $query->{query} =~ /(?:^|\s)[("]*\S$size\*/g;
>
>I have no idea why your httpd is spinning, however without taking into
>account all that your regexp does, wouldn't an adaptation of the following
>work as well (thus avoiding the regex causes spinning problem) :
>
>$cnt = scalar grep /\*/, split(/\s+/, $query->{query});

Oh, sorry.  I'm trying to count up how many words that end in "*" there
are, but grouped by number of letters before the "*".

   query = 'a* and "b* aa*" or (bbb* or foo)'

So there are two single char wilds, one double char, and one three letter
wild.

I'll try using split instead because it's probably the /g that's causing
the problem.

Thanks,



Bill Moseley
mailto:moseley@hank.org

Re: Spinning httpd

Posted by Matt Sergeant <ma...@sergeant.org>.
On Thu, 12 Oct 2000, Bill Moseley wrote:

> I'm in need of some ideas!
> 
> I have a spinning mod_perl process.  I installed a
> 
>   $SIG{USR2} = \&Carp::confess;
> 
> handler and it pointed to this line:
> 
>    $cnt++ while $query->{query} =~ /(?:^|\s)[("]*\S$size\*/g;

Try:

$cnt++ while $query->{query} =~ /\G(?:^|\s)[("]*\S$size\*/gc;

-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\


Re: Spinning httpd

Posted by Robin Berjon <ro...@knowscape.com>.
At 10:28 12/10/2000 -0700, Bill Moseley wrote:
>I have a spinning mod_perl process.  I installed a
>  $SIG{USR2} = \&Carp::confess;
>handler and it pointed to this line:
>   $cnt++ while $query->{query} =~ /(?:^|\s)[("]*\S$size\*/g;

I have no idea why your httpd is spinning, however without taking into
account all that your regexp does, wouldn't an adaptation of the following
work as well (thus avoiding the regex causes spinning problem) :

$cnt = scalar grep /\*/, split(/\s+/, $query->{query});

hth



-- robin b.
Smoking is one of the leading causes of statistics.