Ok, I've had the chance to experiment a bit more with
BSD::Resource::setrlimit function.  After I sent my last message to the
mailing list, I again accessed the Apache::Status Resource Limits page,
and this time RLIMIT_DATA was unset.  I reloaded the page several times,
and the behavior seemed sporadic -- sometimes RLIMIT_DATA was set and
sometimes not. I added a line of code to the Apache::Resource module to
print out the PID before the resource limits table, and it seems that
only one or two of the processes have RLIMIT_DATA set.  These are child
processes, too.

I got this behavior when I put my setrlimit-calling module as a
PerlFixupHanlder or as a PerlChildInitHandler.

Can anyone tell me how to consistently set RLIMIT_DATA for all httpd
processes?

Thanks.

- Simon

> -----Original Message-----
> From: Simon Miner [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, October 28, 1999 3:11 PM
> To:   'Vivek Khera'; Simon Miner
> Cc:   'mod_perl Mailing List'; Win Mattina
> Subject:      RE: Apache::Resource
> 
> Interesting...
> 
> When I use Apache::Resource as my PerlFixupHandler, Apache::Status
> reports that there is no resource limit set for RLIMIT_DATA.  However,
> when I explicitly call BSD::Resource::setrlimit in my custom
> PerlFixupHandler, Apache::Status says that the resource limits are
> set.
> So, it still appears that there's something amiss with
> Apache::Resource.
> Any ideas?
> 
> - Simon
> 
> > -----Original Message-----
> > From:       Vivek Khera [SMTP:[EMAIL PROTECTED]]
> > Sent:       Thursday, October 28, 1999 2:37 PM
> > To: Simon Miner
> > Cc: 'mod_perl Mailing List'; Win Mattina
> > Subject:    Re: Apache::Resource
> > 
> > >>>>> "SM" == Simon Miner <[EMAIL PROTECTED]> writes:
> > 
> > SM> Hi:
> > SM> I'm having difficulty getting Apache::Resource to work.  I've
> > tried
> > SM> calling the module as a PerlChildInitHandler and as a
> > PerlFixupHandler,
> > SM> and I've tried telling it which resource to limit in the
> following
> > ways.
> > 
> > Working example:
> > 
> > # protect from runaway child processes.
> > # Apache::Resource loaded in startup.perl below.
> > #
> > # limit CPU usage in seconds
> > PerlSetEnv PERL_RLIMIT_CPU 60:600
> > # limit DATA segment in MB
> > PerlSetEnv PERL_RLIMIT_DATA 32:64
> > PerlChildInitHandler Apache::Resource
> > 
> > # startup.perl loads all functions that we want to use within
> mod_perl
> > # this script is run while we are still "root".
> > PerlScript /home/khera/proj/newprizes/website/conf/startup.perl
> > 
> > And my startup.perl has "use Apache::Resource".
> > 
> > If you configure Apache::Status, it will let you review the
> resources
> > set this way.
> > 
> > Now, the only question I might have is: "does Solaris 2.7 support
> BSD
> > style resource limits"?  I don't know.  That may be the problem.
> > 
> > -- 
> >
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > Vivek Khera, Ph.D.                Khera Communications, Inc.
> > Internet: [EMAIL PROTECTED]       Rockville, MD
> +1-301-545-6996
> > PGP & MIME spoken here            http://www.kciLink.com/home/khera/

Reply via email to