Re: mod_perl and open files limit

2002-04-09 Thread Mike V. Andreev

Hello people
Thank you for all your answers and comments!
Unfortunately I can't test your advices right now because of other urgent 
[as always :-(  ] businesses.
I'll do it as soon as i'll be able.
Thanx a lot!!!


Mike Andreev




Re: mod_perl and open files limit

2002-04-08 Thread Perrin Harkins

Ged Haywood wrote:
> I'd suggest setting MaxRequestsPerChild to a low value (I generally
> use something in the range of 50-100 but Perrin will tell you that's
> *very* low... :) to avoid leak problems.

A setting of 0 is fine, as long as you are using Apache::SizeLimit or 
Apache::GTopLimit.  In fact, that's the best way to do it, since it 
gives your child processes the longest possible lifespan while 
preventing them from getting too big.

As for the source of the original problem, it is probably a bug in the 
local code.  You should check to make sure all of your filehandles are 
being closed.  The other suspicious-sounding module is 
Apache::Lock::File.  You can check it by replacing it with NullLocker 
and watching to see if the problem disappears.

- Perrin




Re: mod_perl and open files limit

2002-04-06 Thread Ged Haywood

Hi again,

On Thu, 4 Apr 2002, Mike V. Andreev wrote:

> MaxRequestsPerChild 0 -- if I set this limit to 10 then the problem disappear
> but that way deprives project of mod_perl usage advantages

Not at all, for example 90 percent of your requests won't have to
reload Perl.  (Of course they won't all need to but the other ten
percent will reload it anyway unless you're using a light front
end... :).  But even I wouldn't usually use a value as low as 10.

Anyway, it looks like you're on the right track - probably a filehandle
not being closed or something.  Why not try using the Symbol::gensym
technique as shown in the Guide, this closes filehandles automatically
when they go out of scope.  It works very well for me.

73,
Ged.

PS: BTW it's modperlperlapacheorg now




Re: mod_perl and open files limit

2002-04-06 Thread Ged Haywood

Hi there,

On Wed, 3 Apr 2002, Mike V. Andreev wrote:

> files limit problem.
> 
> httpd.conf:
> KeepAlive On
> MaxKeepAliveRequests 100
> KeepAliveTimeout 15
> MinSpareServers 5
> MaxSpareServers 10
> StartServers 5
> MaxRequestsPerChild 0

MaxClients?

> What kind of diagnostics can be done to find out what causes the problem?

http://perl.apache.org/guide has a lot of useful pointers.

I'd suggest setting MaxRequestsPerChild to a low value (I generally
use something in the range of 50-100 but Perrin will tell you that's
*very* low... :) to avoid leak problems.

73,
Ged.




Re: mod_perl and open files limit

2002-04-06 Thread jon schatz

On Thu, 2002-04-04 at 00:46, Mike V. Andreev wrote:
> Hello.

hi.

> During the work with web interface 
> number of open files slowly grows and finally reaches OS limit. 
> And this happens with only 2-3 users working with interface !!!
> If to restart apache number of open files comes back in norm, so I think that
> the problem roots in my way of mod_perl usage.

first of all, is your code closing all the filehandles it opens? garbage
collection works differently in mod_perl, and unless you explicitly
close fh's, they have the tendency to stay around for awhile.

> What kind of diagnostics can be done to find out what causes the  
> problem?

try lsof(8), which will list all open files (and the process they belong
to).

-jon

-- 
[EMAIL PROTECTED] || www.divisionbyzero.com
gpg key: www.divisionbyzero.com/pubkey.asc
think i have a virus? www.divisionbyzero.com/pgp.html
"You are in a twisty little maze of Sendmail rules, all confusing." 



signature.asc
Description: This is a digitally signed message part


mod_perl and open files limit

2002-04-06 Thread Mike V. Andreev


Hello.

I develop now my first project on mod_perl. 
When we started to test this project on separate server we faced excess opened
files limit problem. There are no other serious tasks on this server, only 
mysql with project databases and apache. During the work with web interface 
number of open files slowly grows and finally reaches OS limit. 
And this happens with only 2-3 users working with interface !!!
If to restart apache number of open files comes back in norm, so I think that
the problem roots in my way of mod_perl usage.

My scripts use this modules: Apache::Registry, Apache::DBI, HTML::Embperl,
Apache::Store::MySQL, Apache::Lock::File. There are 3 different persistent database 
connections per each httpd child process.

OS: FreeBSD 4.3-RELEASE
kern.maxfiles: 1064 -- that can be increased of course, but we need to be
sure that number of open files will not grow unlimited

httpd.conf:
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxRequestsPerChild 0 -- if I set this limit to 10 then the problem disappear
but that way deprives project of mod_perl usage advantages

What kind of diagnostics can be done to find out what causes the problem?


Mike Andreev



mod_perl and open files limit

2002-04-06 Thread Mike V. Andreev


Hello.

I develop now my first project on mod_perl. 
When we started to test this project on separate server we faced excess opened
files limit problem. There are no other serious tasks on this server, only 
mysql with project databases and apache. During the work with web interface 
number of open files slowly grows and finally reaches OS limit. 
And this happens with only 2-3 users working with interface !!!
If to restart apache number of open files comes back in norm, so I think that
the problem roots in my way of mod_perl usage.

My scripts use this modules: Apache::Registry, Apache::DBI, HTML::Embperl,
Apache::Store::MySQL, Apache::Lock::File. There are 3 different persistent database 
connections per each httpd child process.

OS: FreeBSD 4.3-RELEASE
kern.maxfiles: 1064 -- that can be increased of course, but we need to be
sure that number of open files will not grow unlimited

httpd.conf:
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxRequestsPerChild 0

What kind of diagnostics can be done to find out what causes the problem?


Mike Andreev