You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Buddy Lee Haystack <ha...@email.rentzone.org> on 2000/11/06 23:49:05 UTC
Memory Usage
I'm using
RedHat Linux v6.1 on an Intel PII SMP box
Apache v1.3.14
mod_perl v 1.23
Apache::DBI 0.87
DBI v1.13
DBD Pg v0.93
PostgreSQL v6.5.3
The morning after "logrotate" runs on my system, the memory usage increases by about 30
megabytes, and continues to do so after each weekly run of the "logrotate" utility.
Has anyone else had this experience? I'd like to rotate my logs weekly, but at this rate
I'll run out of ram in a couple of months.
Thanks!
--
BLH
www.RentZone.org
--
BLH
www.RentZone.org
Re: Memory Usage
Posted by Ričardas Čepas <rc...@richard.eu.org>.
On Tue Nov 7 09:37:02 2000 -0500 Buddy Lee Haystack wrote:
> Thank you very much! Now I know why most of the people on this list don't use DSO.
>
> Is there any other work around for this situation other than rotating my logs less frequently? Maybe a different method of rotating my logs like using the TERM signal instead of the HUP signal?
>
The obvious answer would be logging to 'rotatelogs' pipe.
--
☻ Ričardas Čepas ☺
~~
~
Re: Memory Usage
Posted by Buddy Lee Haystack <ha...@email.rentzone.org>.
Thank you very much! Now I know why most of the people on this list don't use DSO.
Is there any other work around for this situation other than rotating my logs less frequently? Maybe a different method of rotating my logs like using the TERM signal instead of the HUP signal?
Thanks!
Jens-Uwe Mager wrote:
>
> On Mon, Nov 06, 2000 at 05:49:05PM -0500, Buddy Lee Haystack wrote:
> > I'm using
> >
> > RedHat Linux v6.1 on an Intel PII SMP box
> > Apache v1.3.14
> > mod_perl v 1.23
> > Apache::DBI 0.87
> > DBI v1.13
> > DBD Pg v0.93
> > PostgreSQL v6.5.3
> >
> > The morning after "logrotate" runs on my system, the memory usage
> > increases by about 30 megabytes, and continues to do so after each
> > weekly run of the "logrotate" utility.
> >
> > Has anyone else had this experience? I'd like to rotate my logs
> > weekly, but at this rate I'll run out of ram in a couple of months.
>
> This happens if mod_perl is compiled as a DSO, this will not happen if
> mod_perl is compiled statically into the httpd core. I believe that this
> has something to do with the way perl allocates variable and stashes
> them away in static or global variables. If mod_perl is compiled as a
> DSO, httpd will completely unload and reload all DSO's on a restart and
> cause all global/static variables to be reset to NULL, forgetting all
> traces about previously allocated memory. If mod_perl is built
> statically, it will not be reloaded and thus all global/static variables
> persist and perl will re-use the memory allocated.
>
> --
> Jens-Uwe Mager
>
> HELIOS Software GmbH
> Steinriede 3
> 30827 Garbsen
> Germany
>
> Phone: +49 5131 709320
> FAX: +49 5131 709325
> Internet: jum@helios.de
--
BLH
www.RentZone.org
Re: Memory Usage
Posted by Jens-Uwe Mager <ju...@helios.de>.
On Mon, Nov 06, 2000 at 05:49:05PM -0500, Buddy Lee Haystack wrote:
> I'm using
>
> RedHat Linux v6.1 on an Intel PII SMP box
> Apache v1.3.14
> mod_perl v 1.23
> Apache::DBI 0.87
> DBI v1.13
> DBD Pg v0.93
> PostgreSQL v6.5.3
>
> The morning after "logrotate" runs on my system, the memory usage
> increases by about 30 megabytes, and continues to do so after each
> weekly run of the "logrotate" utility.
>
> Has anyone else had this experience? I'd like to rotate my logs
> weekly, but at this rate I'll run out of ram in a couple of months.
This happens if mod_perl is compiled as a DSO, this will not happen if
mod_perl is compiled statically into the httpd core. I believe that this
has something to do with the way perl allocates variable and stashes
them away in static or global variables. If mod_perl is compiled as a
DSO, httpd will completely unload and reload all DSO's on a restart and
cause all global/static variables to be reset to NULL, forgetting all
traces about previously allocated memory. If mod_perl is built
statically, it will not be reloaded and thus all global/static variables
persist and perl will re-use the memory allocated.
--
Jens-Uwe Mager
HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany
Phone: +49 5131 709320
FAX: +49 5131 709325
Internet: jum@helios.de
Re: Memory Usage
Posted by Jens-Uwe Mager <ju...@helios.de>.
On Tue, Nov 07, 2000 at 12:38:09PM -0500, Buddy Lee Haystack wrote:
> I may have missed that, but it dosen't mention the "experimental"
> nature of DSO in the "DSO has the following disadvantages:" section of
> the documentation located at "http://www.apache.org/docs/dso.html"
Wait a sec, not _Apache DSO's_ in general are experimental, these appear
to work quite fine. The problem is with mod_perl as a DSO, that is one
particular Apache module that has the problem. And this is probably not
even mod_perl's fault but the way perl itself is managing memory.
--
Jens-Uwe Mager
HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany
Phone: +49 5131 709320
FAX: +49 5131 709325
Internet: jum@helios.de
Re: Memory Usage
Posted by Buddy Lee Haystack <ha...@email.rentzone.org>.
Actually, I did search through the archives for log rotation and memory leaks, but was not able to find any information specifically linking memory issues to log rotation.
If it were not for all the helpful people on this list, I wouldn't have known about all the options I have to minimize the adverse effects of this bug.
Some on this list even suggested that I was the only person suffering this issue, but evidently this is not so. Since I've just subscribed to the list, I wouldn't have any knowledge of your previous posts, which most assuredly would have helped me.
I don't think it's an issue of RedHat, or any other distribution, not providing enough documentation that's the issue here. I just feel that many people could benefit from the inclusion of a warning about mod_perl, DSO & Apache in the location that the Apache Group maintains for this on their website "Apache 1.3 Dynamic Shared Object (DSO) Support [http://www.apache.org/docs/dso.html]." It certainly can't hurt, and is were most people would logically go for information.
Let's face it, many people who purchase a major distribution probably aren't going to use mod_perl; consequently, the vendors may not even be aware of any issues. The knowledge base of the contributors to this list can help many people, especially on this issue, because everyone has to rotate logs sooner or later. From the responses to this particular issue we have seen that quite a few people have had the same experience, even when mod_perl is compiled statically in Apache.
Addressing an issue openly, thoroughly, quickly and responsibly is what separates open source projects from our poor, closed source brethren.
If anyone feels offended or slighted by my somewhat ineloquent, or poorly considered posts, you have my sincerest apologies. Life is too short for conflict.
I think this post has gone on a bit too long, and sapped too much time from everyone's schedule, so I'd like to end it now so that you all can get back to more productive endeavors.
I'd like to thank everyone who helped me out, especially the following: Jens-Uwe Mager for pointing out the source of the issue; Christian Gilmore for the rotation scripts; G.W. Haywood for the perls of wisdom; Gunther Birznieks for yet another option; Ri?ardas ?epas for the piped rotatelogs program suggestion, and Roger Espel Llima for pointing out that the same issue exists with mod_perl compiled statically.
Have a great Day!
Douglas Leonard wrote:
>
> First off, the complaint about the lack of documentation for DSO being
> experimental is a bit offbase IMO. It isn't up to the mod_perl group to
> make sure RedHat includes complete documentation in their build of
> mod_perl.
>
> Also, this issue has been talked about many times on this mailing list.
> Sometime after mod_perl 1.20 was released there was talk that the DSO
> problems had been fixed. I can remember putting out a post myself on
> exactly how to cause the process size to grow using HUP or USR1 when using
> mod_perl 1.21 and 1.22-dev in order to disprove this. It is always best
> to check one of the archives first for this kind of problem IMO.
>
> I find it best to do a daily staggered shutdown/restart of each apache
> server and rotate the logs via a custom script. One minute of downtime
> per server per day isn't exactly noticeable when you have a load balancing
> system set up.
>
> On Tue, 7 Nov 2000, Buddy Lee Haystack wrote:
>
> >
> > Thanks, but as a RedHat [or other typical major distribution] user, I
> > would never see the documentation you mentioned below. Since DSO is
> > still experimental, would it not be an absolute necessity to include
> > that information in the location where most users are directed to look
> > for information about all things Apache? The first place I go to look
> > for information is on the online documentation, and I know that the
> > "experimental" nature of using DSO is not mentioned anywhere in
> > "Apache 1.3 Dynamic Shared Object (DSO)
> > Support" [http://www.apache.org/docs/dso.html].
> >
> > It appears as if the "experimental" nature of DSO's under Apache is
> > fairly well removed from view.
> >
> > Had the information you included below been clearly listed on Apache's
> > website, in the proper location, many people would have made a choice
> > not to use DSO. It appears as if the Apache Group has been a little
> > less than candid in Apache's true support for DSO.
> >
> > IMHO There really needs to be a warning in the documentation on their
> > website explicitly stating the info you've included below.
> >
> <snip>
>
> --
> <Douglas Leonard>
> <dl...@n2h2.com>
--
BLH
www.RentZone.org
Re: Memory Usage
Posted by Douglas Leonard <dl...@n2h2.com>.
First off, the complaint about the lack of documentation for DSO being
experimental is a bit offbase IMO. It isn't up to the mod_perl group to
make sure RedHat includes complete documentation in their build of
mod_perl.
Also, this issue has been talked about many times on this mailing list.
Sometime after mod_perl 1.20 was released there was talk that the DSO
problems had been fixed. I can remember putting out a post myself on
exactly how to cause the process size to grow using HUP or USR1 when using
mod_perl 1.21 and 1.22-dev in order to disprove this. It is always best
to check one of the archives first for this kind of problem IMO.
I find it best to do a daily staggered shutdown/restart of each apache
server and rotate the logs via a custom script. One minute of downtime
per server per day isn't exactly noticeable when you have a load balancing
system set up.
On Tue, 7 Nov 2000, Buddy Lee Haystack wrote:
>
> Thanks, but as a RedHat [or other typical major distribution] user, I
> would never see the documentation you mentioned below. Since DSO is
> still experimental, would it not be an absolute necessity to include
> that information in the location where most users are directed to look
> for information about all things Apache? The first place I go to look
> for information is on the online documentation, and I know that the
> "experimental" nature of using DSO is not mentioned anywhere in
> "Apache 1.3 Dynamic Shared Object (DSO)
> Support" [http://www.apache.org/docs/dso.html].
>
> It appears as if the "experimental" nature of DSO's under Apache is
> fairly well removed from view.
>
> Had the information you included below been clearly listed on Apache's
> website, in the proper location, many people would have made a choice
> not to use DSO. It appears as if the Apache Group has been a little
> less than candid in Apache's true support for DSO.
>
> IMHO There really needs to be a warning in the documentation on their
> website explicitly stating the info you've included below.
>
<snip>
--
<Douglas Leonard>
<dl...@n2h2.com>
Re: Memory Usage
Posted by Buddy Lee Haystack <ha...@email.rentzone.org>.
Thanks, but as a RedHat [or other typical major distribution] user, I would never see the documentation you mentioned below. Since DSO is still experimental, would it not be an absolute necessity to include that information in the location where most users are directed to look for information about all things Apache? The first place I go to look for information is on the online documentation, and I know that the "experimental" nature of using DSO is not mentioned anywhere in "Apache 1.3 Dynamic Shared Object (DSO)
Support" [http://www.apache.org/docs/dso.html].
It appears as if the "experimental" nature of DSO's under Apache is fairly well removed from view.
Had the information you included below been clearly listed on Apache's website, in the proper location, many people would have made a choice not to use DSO. It appears as if the Apache Group has been a little less than candid in Apache's true support for DSO.
IMHO There really needs to be a warning in the documentation on their website explicitly stating the info you've included below.
"G.W. Haywood" wrote:
>
> Hi again,
>
> On Tue, 7 Nov 2000, Buddy Lee Haystack wrote:
>
> > I may have missed that, but it dosen't mention the "experimental"
> > nature of DSO in the "DSO has the following disadvantages:" section
> > of the documentation located at
> > "http://www.apache.org/docs/dso.html"
>
> Extract from my copy of the Guide source (install.pod):
> ----------------------------------------------------------------------
> =head2 Build mod_perl as a DSO inside the Apache Source Tree via APACI
>
> B<Warning>: I<THIS IS STILL EXPERIMENTAL, SO BE WARNED!>
>
> With Apache 1.3 there is support for building modules as Dynamic
> Shared Objects (DSO). So there is support for DSO in mod_perl now,
> too. Your mileage may vary. Almost certainly it will.
>
> B<Warning>: I<YOU HAVE BEEN WARNED!>
> ----------------------------------------------------------------------
>
> 73,
> Ged.
--
BLH
www.RentZone.org
Re: Memory Usage
Posted by "G.W. Haywood" <ge...@www.jubileegroup.co.uk>.
Hi again,
On Tue, 7 Nov 2000, Buddy Lee Haystack wrote:
> I may have missed that, but it dosen't mention the "experimental"
> nature of DSO in the "DSO has the following disadvantages:" section
> of the documentation located at
> "http://www.apache.org/docs/dso.html"
Extract from my copy of the Guide source (install.pod):
----------------------------------------------------------------------
=head2 Build mod_perl as a DSO inside the Apache Source Tree via APACI
B<Warning>: I<THIS IS STILL EXPERIMENTAL, SO BE WARNED!>
With Apache 1.3 there is support for building modules as Dynamic
Shared Objects (DSO). So there is support for DSO in mod_perl now,
too. Your mileage may vary. Almost certainly it will.
B<Warning>: I<YOU HAVE BEEN WARNED!>
----------------------------------------------------------------------
73,
Ged.
Re: Memory Usage
Posted by Buddy Lee Haystack <ha...@email.rentzone.org>.
I may have missed that, but it dosen't mention the "experimental" nature of DSO in the
"DSO has the following disadvantages:" section of the documentation located at
"http://www.apache.org/docs/dso.html"
"G.W. Haywood" wrote:
>
> Hi again,
>
> On Tue, 7 Nov 2000, Buddy Lee Haystack wrote:
>
> > Maybe someone should include this information in the Apache
> > documentation covering the DSO issues. It would be very helpful to
> > people starting out, such as myself.
>
> It *does* say in the docs that DSO is experimental.
>
> 73,
> Ged.
--
BLH
www.RentZone.org
Re: Memory Usage
Posted by "G.W. Haywood" <ge...@www.jubileegroup.co.uk>.
Hi again,
On Tue, 7 Nov 2000, Buddy Lee Haystack wrote:
> Maybe someone should include this information in the Apache
> documentation covering the DSO issues. It would be very helpful to
> people starting out, such as myself.
It *does* say in the docs that DSO is experimental.
73,
Ged.
Re: Memory Usage
Posted by Buddy Lee Haystack <ha...@email.rentzone.org>.
Yes, I also believe that this is probably the cause of many "memory leak" issues people experience with mod_perl using DSO. Had I known of this issue, I would have budgeted the time to role my own version. I will do so as time permits, but not for a while.
Maybe someone should include this information in the Apache documentation covering the DSO issues. It would be very helpful to people starting out, such as myself.
Jens-Uwe Mager wrote:
>
> On Tue, Nov 07, 2000 at 03:59:34PM +0000, G.W. Haywood wrote:
>
> > I also never build mod_perl as a DSO. For the life of me I can't
> > understand why so many people do it, and then they act all surprised
> > when things go wrong.
>
> It is a matter of flexibility, especially if you are a distribution
> vendor like RedHat or SuSE. Not all your customers will want perl in
> their server, and using the DSO way of doing things only those folks
> that need it can put the proper directive to load it into their
> httpd.conf. That the DSO version is buggy in this regard is different
> matter alltogether. I am wondering if other folks that embed perl
> interpreters into their applications are having similar problems. I
> would believe that is a general perl bug.
>
> --
> Jens-Uwe Mager
>
> HELIOS Software GmbH
> Steinriede 3
> 30827 Garbsen
> Germany
>
> Phone: +49 5131 709320
> FAX: +49 5131 709325
> Internet: jum@helios.de
--
BLH
www.RentZone.org
Re: Memory Usage
Posted by Jens-Uwe Mager <ju...@helios.de>.
On Tue, Nov 07, 2000 at 03:59:34PM +0000, G.W. Haywood wrote:
> I also never build mod_perl as a DSO. For the life of me I can't
> understand why so many people do it, and then they act all surprised
> when things go wrong.
It is a matter of flexibility, especially if you are a distribution
vendor like RedHat or SuSE. Not all your customers will want perl in
their server, and using the DSO way of doing things only those folks
that need it can put the proper directive to load it into their
httpd.conf. That the DSO version is buggy in this regard is different
matter alltogether. I am wondering if other folks that embed perl
interpreters into their applications are having similar problems. I
would believe that is a general perl bug.
--
Jens-Uwe Mager
HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany
Phone: +49 5131 709320
FAX: +49 5131 709325
Internet: jum@helios.de
Re: Memory Usage
Posted by Ričardas Čepas <rc...@richard.eu.org>.
On Tue Nov 7 11:57:44 2000 -0500 Buddy Lee Haystack wrote:
>
> I can always rotate my logs manually, or use the Apache rotatelogs program that Ri?ardas ?epas recommended, although if the "rotatelogs" program restarts the server I'll be back to square one - the program's man page just states that it doesn't kill the server, but does that mean that it doesn't restart it? I'm leaning along the lines of just killing the process, rotating the logs, and restarting it. It should take no more than 5 seconds once a week a 4:00am.
>
As far as I understand there is no need for restart in that case. When parent httpd opens log it doesn't open file but creates pipe to another process (rotatelogs) and sends all data to that process. Then rotatelogs takes care about opening and closing files on it's own.
--
☻ Ričardas Čepas ☺
~~
~
Re: Memory Usage
Posted by Buddy Lee Haystack <ha...@email.rentzone.org>.
Thanks!
I was under the mistaken impression that I was finally finished with the administration side of things...
Oh well...
"G.W. Haywood" wrote:
>
> Hi there,
>
> On Tue, 7 Nov 2000, Buddy Lee Haystack wrote:
>
> > The memory consumption increases by about 1 megabyte for each child
> > process every time I issued the USR1 signal.
>
> Ugh.
>
> > I can always rotate my logs manually, I'm leaning along the lines of
> > just killing the process, rotating the logs, and restarting it. It
> > should take no more than 5 seconds once a week a 4:00am.
>
> Yup.
>
> > What concerns me even more is the fact that I have Apache restart
> > child processes after they each serve 100 requests
> > [MaxRequestsPerChild 100] it's a RedHat default that is supposed to
> > reduce memory leaks,
>
> It tends to reduce the effect of them. The leaks are still there.
>
> > but with mod_perl & DSO it may actually have the opposite effect. I
> > can easily increase the value, or remove it altogether. Any
> > recommendations?
>
> I'd say compile static and do that anyway. Definitely don't remove it
> nor set it to zero. You aren't out of the memory leak woods just
> because you don't use DSO. 100 is towards the upper limit of what I'd
> use, and towards the lower limit of what most other people will use.
>
> > I take it that by far the most prudent course of action would be to
> > role my own, and compile mod_perl statically. I may have to do just
> > that, but I won't have the time to do so until December;
>
> It shouldn't take very long to compile. Takes me ten minutes using a
> file called makepl_args.mod_perl containing my configuration options,
> in the top level of the mod_perl directory. The command line goes:
>
> c2h5oh:/usr/src/mod_perl# >>> perl Makefile.pl && make && make install
>
> Then I just stop the old server and start the new one.
>
> 73,
> Ged.
--
BLH
www.RentZone.org
Re: Memory Usage
Posted by "G.W. Haywood" <ge...@www.jubileegroup.co.uk>.
Hi there,
On Tue, 7 Nov 2000, Buddy Lee Haystack wrote:
> The memory consumption increases by about 1 megabyte for each child
> process every time I issued the USR1 signal.
Ugh.
> I can always rotate my logs manually, I'm leaning along the lines of
> just killing the process, rotating the logs, and restarting it. It
> should take no more than 5 seconds once a week a 4:00am.
Yup.
> What concerns me even more is the fact that I have Apache restart
> child processes after they each serve 100 requests
> [MaxRequestsPerChild 100] it's a RedHat default that is supposed to
> reduce memory leaks,
It tends to reduce the effect of them. The leaks are still there.
> but with mod_perl & DSO it may actually have the opposite effect. I
> can easily increase the value, or remove it altogether. Any
> recommendations?
I'd say compile static and do that anyway. Definitely don't remove it
nor set it to zero. You aren't out of the memory leak woods just
because you don't use DSO. 100 is towards the upper limit of what I'd
use, and towards the lower limit of what most other people will use.
> I take it that by far the most prudent course of action would be to
> role my own, and compile mod_perl statically. I may have to do just
> that, but I won't have the time to do so until December;
It shouldn't take very long to compile. Takes me ten minutes using a
file called makepl_args.mod_perl containing my configuration options,
in the top level of the mod_perl directory. The command line goes:
c2h5oh:/usr/src/mod_perl# >>> perl Makefile.pl && make && make install
Then I just stop the old server and start the new one.
73,
Ged.
Re: Memory Usage
Posted by Gunther Birznieks <gu...@extropia.com>.
One potential tip to offer is that if you want to rotate your logs but not
do a hard restart on the server, use something else for the log generation.
You may want to try out mod_log_spread from the mod_backhand site. If it's
not too difficult to setup, then you might be able to use another server
for logging.
At 04:26 PM 11/7/2000 -0500, Buddy Lee Haystack wrote:
>Thanks Christian!
>
>Scripts would be nice.;-)
>
>I take it you've used DSO much more than I have, so I'm interested in any
>information in addition to that provided by the kind "G.W. Haywood" to the
>following:
>
>"What concerns me even more is the fact that I have Apache restart child
>processes after they each serve 100 requests [MaxRequestsPerChild 100]
>it's a RedHat default that is supposed to reduce memory leaks, but with
>mod_perl & DSO it may actually have the opposite effect. I can easily
>increase the value, or remove it altogether. Any recommendations?"
>
>
>Christian Gilmore wrote:
> >
> > > I'm leaning along the lines of just killing the
> > > process, rotating the logs, and restarting it. It should take
> > > no more than 5 seconds once a week a 4:00am.
> >
> > This is exactly what I do, except I have it scripted. The downside is that
> > your service is unavailable for a few seconds (maybe more depending upon
> > the length of time it takes for the parent to wipe out all the old
> > children). I'd be happy to share the script, provided my boss doesn't
> > mind. :)
> >
> > Regards,
> > Christian
>
>--
>BLH
>www.RentZone.org
__________________________________________________
Gunther Birznieks (gunther.birznieks@extropia.com)
eXtropia - The Web Technology Company
http://www.extropia.com/
Re: Memory Usage
Posted by Jens-Uwe Mager <ju...@helios.de>.
On Tue, Nov 07, 2000 at 04:26:45PM -0500, Buddy Lee Haystack wrote:
> I take it you've used DSO much more than I have, so I'm interested in
> any information in addition to that provided by the kind "G.W.
> Haywood" to the following:
>
> "What concerns me even more is the fact that I have Apache restart
> child processes after they each serve 100 requests
> [MaxRequestsPerChild 100] it's a RedHat default that is supposed to
> reduce memory leaks, but with mod_perl & DSO it may actually have the
> opposite effect. I can easily increase the value, or remove it
> altogether. Any recommendations?"
I do not think that this is a problem, as if a client dies after it has
done it's number of requests it will not load and reload all DSO's, it
will just fork a fresh copy of the master and be done with it. I think
the problem only happens with the restart signal.
--
Jens-Uwe Mager
HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany
Phone: +49 5131 709320
FAX: +49 5131 709325
Internet: jum@helios.de
RE: Memory Usage
Posted by Christian Gilmore <Ch...@tivoli.com>.
Find attached the rotatelogs.pl script. My experience is that killing off
children after so much usage is a GoodThing (tm). So long as the parent
remains at a stable size, things should go ok.
Regards,
Christian
> -----Original Message-----
> From: root@email.rentzone.org
> [mailto:root@email.rentzone.org]On Behalf
> Of Buddy Lee Haystack
> Sent: Tuesday, November 07, 2000 3:27 PM
> To: Christian Gilmore
> Cc: 'G.W. Haywood'; 'mod_perl list'
> Subject: Re: Memory Usage
>
>
> Thanks Christian!
>
> Scripts would be nice.;-)
>
> I take it you've used DSO much more than I have, so I'm
> interested in any information in addition to that provided by
> the kind "G.W. Haywood" to the following:
>
> "What concerns me even more is the fact that I have Apache
> restart child processes after they each serve 100 requests
> [MaxRequestsPerChild 100] it's a RedHat default that is
> supposed to reduce memory leaks, but with mod_perl & DSO it
> may actually have the opposite effect. I can easily increase
> the value, or remove it altogether. Any recommendations?"
>
>
> Christian Gilmore wrote:
> >
> > > I'm leaning along the lines of just killing the
> > > process, rotating the logs, and restarting it. It should take
> > > no more than 5 seconds once a week a 4:00am.
> >
> > This is exactly what I do, except I have it scripted. The
> downside is that
> > your service is unavailable for a few seconds (maybe more
> depending upon
> > the length of time it takes for the parent to wipe out all the old
> > children). I'd be happy to share the script, provided my
> boss doesn't
> > mind. :)
> >
> > Regards,
> > Christian
>
> --
> BLH
> www.RentZone.org
>
Re: Memory Usage
Posted by Buddy Lee Haystack <ha...@email.rentzone.org>.
Thanks Christian!
Scripts would be nice.;-)
I take it you've used DSO much more than I have, so I'm interested in any information in addition to that provided by the kind "G.W. Haywood" to the following:
"What concerns me even more is the fact that I have Apache restart child processes after they each serve 100 requests [MaxRequestsPerChild 100] it's a RedHat default that is supposed to reduce memory leaks, but with mod_perl & DSO it may actually have the opposite effect. I can easily increase the value, or remove it altogether. Any recommendations?"
Christian Gilmore wrote:
>
> > I'm leaning along the lines of just killing the
> > process, rotating the logs, and restarting it. It should take
> > no more than 5 seconds once a week a 4:00am.
>
> This is exactly what I do, except I have it scripted. The downside is that
> your service is unavailable for a few seconds (maybe more depending upon
> the length of time it takes for the parent to wipe out all the old
> children). I'd be happy to share the script, provided my boss doesn't
> mind. :)
>
> Regards,
> Christian
--
BLH
www.RentZone.org
RE: Memory Usage
Posted by Christian Gilmore <Ch...@tivoli.com>.
> I'm leaning along the lines of just killing the
> process, rotating the logs, and restarting it. It should take
> no more than 5 seconds once a week a 4:00am.
This is exactly what I do, except I have it scripted. The downside is that
your service is unavailable for a few seconds (maybe more depending upon
the length of time it takes for the parent to wipe out all the old
children). I'd be happy to share the script, provided my boss doesn't
mind. :)
Regards,
Christian
Re: Memory Usage
Posted by Roger Espel Llima <es...@iagora.net>.
Buddy Lee Haystack <ha...@email.rentzone.org> wrote:
> The memory consumption increases by about 1 megabyte for each child
> process every time I issued the USR1 signal. Which is kind of what I
> expected given Jens-Uwe Mager's explanation of DSO's failings with
> mod_perl.
FWIW, I get a 240k increase in httpd size every time I send a USR1
signal to apache, and that is with a 100% static Apache/mod_perl,
without even mod_so compiled in.
Doing a few "ps"s during the graceful restart process, it looks like all
child processes die, then the parent grows and starts respawning new
children.
It smells to me like the leak is in mod_perl reloading the perl modules
themselves. If I trim httpd.conf down so it only loads a very minimal
"hello world" handler, then the leak goes down to 64k per restart.
I've gathered from this list that the 'canonical' answer to these
problems is Apache::Reload, but I've been reluctant to use it because it
would presumably reload the modules separately in each child, and
therefore leaving them unshared.
So for the moment what I do is restart apache for real every couple
weeks. It's only a couple seconds of downtime...
--
Roger Espel Llima, espel@iagora.net
http://www.iagora.com/~espel/index.html
Re: Memory Usage
Posted by Buddy Lee Haystack <ha...@email.rentzone.org>.
> What happens if you then do a graceful restart?
The memory consumption increases by about 1 megabyte for each child process every time I issued the USR1 signal. Which is kind of what I expected given Jens-Uwe Mager's explanation of DSO's failings with mod_perl.
I can always rotate my logs manually, or use the Apache rotatelogs program that Ri?ardas ?epas recommended, although if the "rotatelogs" program restarts the server I'll be back to square one - the program's man page just states that it doesn't kill the server, but does that mean that it doesn't restart it? I'm leaning along the lines of just killing the process, rotating the logs, and restarting it. It should take no more than 5 seconds once a week a 4:00am.
What concerns me even more is the fact that I have Apache restart child processes after they each serve 100 requests [MaxRequestsPerChild 100] it's a RedHat default that is supposed to reduce memory leaks, but with mod_perl & DSO it may actually have the opposite effect. I can easily increase the value, or remove it altogether. Any recommendations?
I take it that by far the most prudent course of action would be to role my own, and compile mod_perl statically. I may have to do just that, but I won't have the time to do so until December; consequently, I need a temporary fix to last about a month.
I'd like to thank everyone for helping me.
Have a great day, and any additional input will be greatly appreciated!
"G.W. Haywood" wrote:
>
> Hi there,
>
> What happens if you then do a graceful restart?
--
BLH
www.RentZone.org
RE: Memory Usage
Posted by Christian Gilmore <Ch...@tivoli.com>.
> I also never build mod_perl as a DSO. For the life of me I can't
> understand why so many people do it, and then they act all surprised
> when things go wrong.
I do it out of a desire to not have multiple builds of apache lying around
for the various needs I have of each service I run. For those that run on
a small handful of service types, DSO may not be as handy, but when you
run more than 10 distinct service types, each requiring their own set of
modules added or removed, you become thankful for just needing alternate
configuration files than having multiple builds of apache hanging around.
You become much more thankful when it comes time to upgrade to the next
minor version of apache.
Regards,
Christian
Re: Memory Usage
Posted by "G.W. Haywood" <ge...@www.jubileegroup.co.uk>.
Hi there,
On Tue, 7 Nov 2000, Buddy Lee Haystack wrote:
> > What happens if you then do a graceful restart?
>
> The logrotate scripts use HUP to restart the server. I don't think
> the USR1 would be appropriate for log rotation - according to the
> Apache documentation...
Yeah, I read that. I didn't mean to imply that you should try
modifying the way you do things just yet. I just wanted to know what
happens if you then do a graceful restart. So let me rephrase that...
What happens if you then do a graceful restart?
> > I don't do it that way.
>
> I'm all ears. ;-)
I rotate logs manually. You'll tell me that it's a pain and I can't
have a very busy site, and stuff like that. I'll say yes, it is, and
I have a big disc partition, and that it doesn't matter if it fills up.
I also never build mod_perl as a DSO. For the life of me I can't
understand why so many people do it, and then they act all surprised
when things go wrong.
73,
Ged.
Re: Memory Usage
Posted by Buddy Lee Haystack <ha...@email.rentzone.org>.
"G.W. Haywood" wrote:
>
> Hi there,
>
> On Mon, 6 Nov 2000, Buddy Lee Haystack wrote:
>
> > The morning after "logrotate" runs on my system, the memory usage
> > increases by about 30 megabytes, and continues to do so after each
> > weekly run of the "logrotate" utility.
>
> What happens if you then do a graceful restart?
The logrotate scripts use HUP to restart the server. I don't think the USR1 would be appropriate for log rotation - according to the Apache documentation:
"At present there is no way for a log rotation script using USR1 to know for certain that all children writing the pre-restart log have finished. We suggest that you use a suitable delay after sending the USR1 signal before you do anything with the old log."
> > Has anyone else had this experience?
>Nope. But then I don't do it that way.
I'm all ears. ;-)
--
BLH
www.RentZone.org
Re: Memory Usage
Posted by "G.W. Haywood" <ge...@www.jubileegroup.co.uk>.
Hi there,
On Mon, 6 Nov 2000, Buddy Lee Haystack wrote:
> The morning after "logrotate" runs on my system, the memory usage
> increases by about 30 megabytes, and continues to do so after each
> weekly run of the "logrotate" utility.
What happens if you then do a graceful restart?
> Has anyone else had this experience?
Nope. But then I don't do it that way.
> I'd like to rotate my logs weekly, but at this rate I'll run out of
> ram in a couple of months.
In that case you're probably one of the lucky ones...
73,
Ged.