Re: Redhat httpsd with mod_perl

1999-11-09 Thread Remi Fasol

just a followup: i recompiled perl from the redhat
source rpms and it seems to have fixed my memory
leaks.

thanks to everyone for their help
remi.

 Remi Fasol wrote:
  
  hi there.
  
  i'm having problems with my redhat secure server
 and
  mod_perl combo
  (mod_perl as a DSO). i'm new to mod_perl (and
 system
  administration) but
  obviously am looking forward to getting everything
  figured out.
  
  i believe there is some kind of memory leak (not
 sure
  exactly), but when
  i start the server a typical process has the
 following
  characteristics:
  
  PID USER PRI  NI  SIZE  RSS SHARE STAT  LIB
 %CPU
  %MEM   TIME COMMAND
  6143 nobody 2   0 10720  10M 10072 S   0 
 0.0
  4.1   0:00 httpsd
  
  but after running it for about a day (while
 hitting it
  with 20 page
  requests per minute (pages use Apache::ASP and
 mysql)
  top shows:
  
  PID USER PRI  NI  SIZE  RSS SHARE STAT  LIB
 %CPU
  %MEM   TIME COMMAND
  4722 nobody 0   0 18232  14M  3148 S   0 
 0.0
  5.5   0:25 httpsd
  
  also, at this point the 'Requests per second' and
  'Transfer rate' (as
  told by ApacheBench) have dropped off
 significantly.
  
  can someone point me in the right direction for
  optimizing this setup?
  
  thanks!
  remi


=

__
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com



Re: Redhat httpsd with mod_perl

1999-10-23 Thread Adi

Stas Bekman wrote:
 
 Is it a single script/handler you are testing with?
 
 *all* children at once? You mean you do a single request and it happens?
 The only reason I can think of is parent dirtying its memory pages,
 however I cannot think about a possible way to do this...
 

Yes, I reload VMonitor once, the disk drive chugs for a second, and then
*all* children drop to under 3M shared.

I think the parent process must have been swapped to disk.  It only happens
on my home computer (i.e no network traffic), and only after a while
of inactivity.  And the disk always chugs for a sec right before it happens.

Sorry for bothering you with this.. I feel sheepish now that it looks like
just a disk swap issue.  Is it normal for mod_perl apache processes to
forget their shared memory when they come out of swap?

- Adi



Re: Redhat httpsd with mod_perl

1999-10-22 Thread Adi

Randy,

Thanks so much for the tips.  I got Apache::VMonitor - awesome package, Stas
- and investigated it further.  What I found was that each child loses a
small amount of shared memory during normal use, due to copy-on-write.  In
my case from about 12M to 9M (roughly 25%).  But it stabilizes at 9M shared,
and then all of a sudden *all* of the child processes + the parent drop to
3M shared.  All of them at once.

Could this be due to swapping?  (my site is currently very low traffic)  I
did notice that I could not actively cause the shared memory to dip below
9M.  I had to wait a few minutes, and reload VMonitor after a period of no
activity.

I couldn't test exiting the Apache child, since it isn't a gradual dropoff. 
BTW, how do you terminate an Apache child process from within mod_perl?

Thanks,
- Adi

Randy Harmon wrote:
 
 On Wed, Oct 20, 1999 at 10:47:02PM -0700, Adi wrote:
   On Wed, 20 Oct 1999, Remi Fasol wrote:
  Does anyone know why the shared memory would decrease so dramatically?
 
 Perl code and data both live in the data segment.  As it is used, any time
 it writes information into a new chunk of memory, the memory is
 copied-on-write, becoming not-shared.
 
 You may or may not benefit from exiting your Apache child when its shared
 memory size shrinks too much.  I think a package of Stas Bekman's
 authorship may help you detect that occasion.  It wraps the gtop library in
 perl, so you can monitor 'top' info from mod_perl.
 
 Your own tests will give you an indication of whether this saves memory and
 should also indicate whether there is any performance advantage one way or
 other.
 
 It'd be interesting to hear your story of the results.
 
 Randy



Re: Redhat httpsd with mod_perl

1999-10-21 Thread Adi

 On Wed, 20 Oct 1999, Remi Fasol wrote:
 
  thanks for your suggestions...
 
  as a test, i set MaxRequestsPerChild to 500, but it
  didn't help.
 
  just out of curosity, could it be that i'm using
  mod_perl as a DSO? i've seen alot of warnings against
  that but that's how the redhat secure server is
  configured.

I'm using redhat secure server also, and I too get the decreasing amount of
shared memory as requests are served.  However, my SIZE and RSS don't
increase like yours do.  It looks like a memory leak.

Does anyone know why the shared memory would decrease so dramatically? 
Initially virtually all of the 10M size is shared, then it decreases to
about 3M.  I'm using Apache::ASP-Loader to pre-load all my .asp scripts,
and have all the modules I use pre-loaded into the parent server with
PerlModule's.

- Adi



Re: Redhat httpsd with mod_perl

1999-10-21 Thread Randy Harmon

On Wed, Oct 20, 1999 at 10:47:02PM -0700, Adi wrote:
  On Wed, 20 Oct 1999, Remi Fasol wrote:
 Does anyone know why the shared memory would decrease so dramatically? 

Perl code and data both live in the data segment.  As it is used, any time
it writes information into a new chunk of memory, the memory is
copied-on-write, becoming not-shared.  

You may or may not benefit from exiting your Apache child when its shared
memory size shrinks too much.  I think a package of Stas Bekman's
authorship may help you detect that occasion.  It wraps the gtop library in
perl, so you can monitor 'top' info from mod_perl.

Your own tests will give you an indication of whether this saves memory and
should also indicate whether there is any performance advantage one way or
other.

It'd be interesting to hear your story of the results.

Randy



Redhat httpsd with mod_perl

1999-10-19 Thread Remi Fasol

hi there.

i'm having problems with my redhat secure server and
mod_perl combo
(mod_perl as a DSO). i'm new to mod_perl (and system
administration) but
obviously am looking forward to getting everything
figured out.

i believe there is some kind of memory leak (not sure
exactly), but when
i start the server a typical process has the following
characteristics:

PID USER PRI  NI  SIZE  RSS SHARE STAT  LIB %CPU
%MEM   TIME COMMAND
6143 nobody 2   0 10720  10M 10072 S   0  0.0 
4.1   0:00 httpsd


but after running it for about a day (while hitting it
with 20 page
requests per minute (pages use Apache::ASP and mysql)
top shows:

PID USER PRI  NI  SIZE  RSS SHARE STAT  LIB %CPU
%MEM   TIME COMMAND
4722 nobody 0   0 18232  14M  3148 S   0  0.0 
5.5   0:25 httpsd

also, at this point the 'Requests per second' and
'Transfer rate' (as
told by ApacheBench) have dropped off significantly.

can someone point me in the right direction for
optimizing this setup?

thanks!
remi


=

__
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com