Ok.  So I've installed lsof, although I'm a little unclear on how to use it.
Right now I'm pretty brute force.  Here's what I execute:

lsof | grep httpd | grep myuser | wc -l

This (hopefully) gives me the number of files that my httpd children (owner
"myuser") have open.

When I first file up apache with my code loaded, it is 171.  Then I start
submitting requests, posting a single file to Apache::Request with each
POST. Here's how the count changes with each request:

171 (starting point)
215
225
235
245
255
265
266
267
268
269
270

I have no real conclusion to reach, except that it seems to be leaking
files.

I then ran the same test on a server that had received a couple hundred
files over it's lifespan.  It was at 1472.  It was giving me the following
error on every new POST:

[Thu Apr 13 01:06:12 2000] [error] [Thu Apr 13 01:06:12 2000] null: fdopen
    failed! at /usr/local/apache/notifi/perl/Handler/SubmitHandler.pm
    line 285, <_GEN_243> chunk 15.

That line of code (line 285):  "$blockFile = $nextBlock->fh()".  It asks the
upload block for it's filehandle.

Anyway, short of using some of the other MIME parsing modules to do the
content parse myself, does anyone else have some suggestions?  Unless Apache
isn't respecting the Apache::Request request to free the filehandles when
the pool is destroyed (or unless the pool is never destroyed!) I don't see
how the files aren't going away.

Thanks for the advice so far!  If you have better instructions for using
lsof, I'd also appreciate that!

-jse



> From: Doug MacEachern <[EMAIL PROTECTED]>
> Date: Wed, 12 Apr 2000 22:48:06 -0700 (PDT)
> To: "John S. Evans" <[EMAIL PROTECTED]>
> Cc: modperl <[EMAIL PROTECTED]>
> Subject: Re: Apache::Request
> 
> On Tue, 11 Apr 2000, John S. Evans wrote:
> 
>> I'm using Solaris (SunOS 5.7, according to uname).
>> 
>> The number of files varies, and I can control this if I know what the limits
>> are.  Is the 256 limit per process or for the entire machine?  For instance,
>> if I have 10 apache children going full bore, is the practical limit 25 per
>> child, or 256 per child?
> 
> i think it's per-child.
> 
>> I saw (in the code) that there's one open file per uploaded file.  That
>> should be fine.  I just need to find out if they're getting closed
>> correctly.
>> 
>> What is "lsof"?
> 
> look it up on freshmeat.net, it'll show you what files the process has
> open.  should be useful to see if any files are not being closed.
> 

Reply via email to