You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Daniel <db...@newsfactor.com> on 2001/03/07 00:55:25 UTC

Apache::SpeedLimit

Hi, I'm having a bit of trouble using Apache::Speedlimit


Slightly modified to use Cookie for the $id:
my $id = "$ip:$agent:$usertrack";



After running for about 5 minutes the handler dies with the following in 
the logfile:


[Tue Mar  6 17:32:07 2001] [error] [Tue Mar  6 17:32:07 2001] null: 
Munged shared memory segment (size exceeded?)


This site is fairly busy (5 page per sec not including images).
Looking at the code I don't see where old data is removed from the 
shared memory segment. My errors seem consistent with the shared memory 
segment filling up (it's only 65k).

Is anyone else using Apache::SpeedLimit? If so how?

Thanks in advance,

-- 
Daniel Bohling
NewsFactor Network


Re: Apache::SpeedLimit

Posted by Perrin Harkins <pe...@primenet.com>.
On Tue, 6 Mar 2001, Daniel wrote:
> Hi, I'm having a bit of trouble using Apache::Speedlimit
...
> After running for about 5 minutes the handler dies with the following in 
> the logfile:
> 
> 
> [Tue Mar  6 17:32:07 2001] [error] [Tue Mar  6 17:32:07 2001] null: 
> Munged shared memory segment (size exceeded?)

I would suggest that you ditch Apache::Speedlimit, since it uses
IPC::Shareable which is known to have some performance issues and is
giving you grief about memory size.  Do a quick search in the list
archives for Randal's Stonehenge::Throttle code.  It's fairly easy to
adapt it to use cookies and to count hits within a time window rather
than CPU.  It uses files, and doesn't have to lock them.  Quite fast under
Linux, and even works over NFS if you need a clustered solution.
- Perrin