You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Kevin DeGraaf <ke...@kevindegraaf.net> on 2002/01/25 21:52:17 UTC

Memory leak issue?

Background: I'm running a fresh build of Apache 1.3.22 (no external
modules) on Slackware 8.0, Linux kernel 2.4.5.  This server has a P-III
processor running at 1.0 GHz and 1.0 GB of RAM.  This machine has
T1-equivalent bandwidth (1.5 Mbps) available to it, and serves about 20
virtual hosts.  This server is primarily dedicated to Apache (although it
it also runs a very low-usage PostgreSQL daemon and tinydns/dnscache.)

My problem is this: every 12 to 36 hours, I am paged with a frantic "the
site is down!" message.  More precisely, connections are accepted, but the
clients (or users) time out waiting for any data to be served.  Each time
this happens, I observe the following:

1. The total number of Apache child processes is equal to my MaxClients
setting, as verified by "ps -ef | grep httpd | wc -l".

2. The machine's RAM is completely full, and a good deal of my swap space
is in use as well, as verified by "free -mo".

3. The machine's CPU is hardly used at all, as verified by "top -d 1".

4. Issuing an "apachectl graceful" takes care of the problem; all the
virtual hosts immediately return to full speed.

I don't think that I need to upgrade this machine's RAM -- 1.0 GB should
be more than sufficient for the task at hand.  I also don't want to
periodically HUP Apache -- there has to be a better way.  What am I
missing here?

If it makes any difference: we just deployed an e-commerce application,
developed in-house in Perl, on a very busy vhost.  I thought that Perl
automatically reclaims data-structure memory.  Could this have anything to
do with it?

I'd be happy to make my httpd.conf file available, but I really didn't
change it that much from the default.

=====================
Kevin DeGraaf
Systems Administrator
Solidus Design, Inc.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Memory leak issue?

Posted by Pietro Cagnoni <pc...@mclink.net>.
> Background: I'm running a fresh build of Apache 1.3.22 (no external
> modules) on Slackware 8.0, Linux kernel 2.4.5.  This server has a P-III
> processor running at 1.0 GHz and 1.0 GB of RAM.  This machine has
> T1-equivalent bandwidth (1.5 Mbps) available to it, and serves about 20
> virtual hosts.  This server is primarily dedicated to Apache (although it
> it also runs a very low-usage PostgreSQL daemon and tinydns/dnscache.)
> 
> My problem is this: every 12 to 36 hours, I am paged with a frantic "the
> site is down!" message.  More precisely, connections are accepted, but the
> clients (or users) time out waiting for any data to be served.  Each time
> this happens, I observe the following:
> 
> 1. The total number of Apache child processes is equal to my MaxClients
> setting, as verified by "ps -ef | grep httpd | wc -l".
> 
> 2. The machine's RAM is completely full, and a good deal of my swap space
> is in use as well, as verified by "free -mo".
> 
> 3. The machine's CPU is hardly used at all, as verified by "top -d 1".
> 
> 4. Issuing an "apachectl graceful" takes care of the problem; all the
> virtual hosts immediately return to full speed.
> 
> I don't think that I need to upgrade this machine's RAM -- 1.0 GB should
> be more than sufficient for the task at hand.  I also don't want to
> periodically HUP Apache -- there has to be a better way.  What am I
> missing here?
> 
> If it makes any difference: we just deployed an e-commerce application,
> developed in-house in Perl, on a very busy vhost.  I thought that Perl
> automatically reclaims data-structure memory.  Could this have anything to
> do with it?
> 
> I'd be happy to make my httpd.conf file available, but I really didn't
> change it that much from the default.

try enabling the server-status url, with ExtendedStatus On, and check it
every now and then. you should be able to see the status of the "dead"
httpd daemons.

hope it helps.

pietro.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Memory leak issue?

Posted by jon schatz <jo...@divisionbyzero.com>.
On Fri, 2002-01-25 at 13:05, Kevin DeGraaf wrote:
> Vanilla CGI scripts.  Any suggestions as to how to isolate them as the
> problem?

do you have the ps output from the last time this happened? It sounds
like a runaway cgi script. do you use fork()/exec()/system()/backticks
in your cgi's? what about file operations? next time it happens, check
what's using all the memory (either with ps or top). find the process
and attach to it with strace(1). or you can use perl's debugging toolset
(perldoc perldebug guts, and look for the section entitled "Using
`$ENV{PERL_DEBUG_MSTATS}'. 

hope this helps..

-jon

-- 
jon@divisionbyzero.com || 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." 

Re: Memory leak issue?

Posted by Kevin DeGraaf <ke...@kevindegraaf.net>.
> are you using mod_perl or vanilla cgi-scripts? either of these could
> cause this problem.

Vanilla CGI scripts.  Any suggestions as to how to isolate them as the
problem?

--
Kevin DeGraaf


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Memory leak issue?

Posted by jon schatz <jo...@divisionbyzero.com>.
On Fri, 2002-01-25 at 12:52, Kevin DeGraaf wrote:
> Background: I'm running a fresh build of Apache 1.3.22 (no external
> modules) 
<--snip-->
> If it makes any difference: we just deployed an e-commerce application,
> developed in-house in Perl, on a very busy vhost.  I thought that Perl
> automatically reclaims data-structure memory.  

are you using mod_perl or vanilla cgi-scripts? either of these could
cause this problem. for example (iirc), under mod_perl, you _must_ close
all your file handles, or else you can get memory leaks / segfaults /
problems, whereas a normal cgi script will gracefully handle the close()
for you..

-jon

-- 
jon@divisionbyzero.com || 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." 

Re: how to check syntax of a stand-alone httpd.conf

Posted by "TD - Sales International Holland B.V." <td...@salesint.com>.
On Monday 28 January 2002 05:59, you wrote:

apachectl is just a script, just edit it and change the paths temporarily

> Hello,
>
> I am using apache 1.3.22 on Linux (rh7.2) and
> subject line pretty much says it all.
>
>
> I am *not* interested in checking syntax of httpd.conf
> of a production environment. I am interested
> to be able to check the syntax of a httpd.conf ,sitting
> let say, in /tmp/httpd.conf.test   ...
>
> I guess I can not say:
> apachectl -f /tmp/httpd.conf.test
>
> or the following for that matter:
>
> httpd -f /tmp/httpd.conf.test which actually starts
> a daemon which I do not want to happen....
>
> So how else can I check the syntax of a test stand-alone
> config file ....?
>
> Thanks,
> Farid
> UNM
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: how to check syntax of a stand-alone httpd.conf

Posted by Farid Hamjavar <ha...@unm.edu>.
Hello,

Never mind ..... I did not see "-t" in the man page ...
httpd -f /tmp/httpd.conf.test -t #is the way to do it  ...

Thanks,
Farid
UNM



On Sun, 27 Jan 2002, Farid Hamjavar wrote:

> Date: Sun, 27 Jan 2002 21:59:45 -0700 (MST)
> From: Farid Hamjavar <ha...@unm.edu>
> Reply-To: users@httpd.apache.org
> To: users@httpd.apache.org
> Subject: how to check syntax of a stand-alone httpd.conf 
> 
> 
> Hello,
> 
> I am using apache 1.3.22 on Linux (rh7.2) and
> subject line pretty much says it all.
> 
> 
> I am *not* interested in checking syntax of httpd.conf
> of a production environment. I am interested
> to be able to check the syntax of a httpd.conf ,sitting
> let say, in /tmp/httpd.conf.test   ...
> 
> I guess I can not say:
> apachectl -f /tmp/httpd.conf.test
> 
> or the following for that matter:
> 
> httpd -f /tmp/httpd.conf.test which actually starts
> a daemon which I do not want to happen....
> 
> So how else can I check the syntax of a test stand-alone
> config file ....?
> 
> Thanks,
> Farid
> UNM
> 
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


how to check syntax of a stand-alone httpd.conf

Posted by Farid Hamjavar <ha...@unm.edu>.
Hello,

I am using apache 1.3.22 on Linux (rh7.2) and
subject line pretty much says it all.


I am *not* interested in checking syntax of httpd.conf
of a production environment. I am interested
to be able to check the syntax of a httpd.conf ,sitting
let say, in /tmp/httpd.conf.test   ...

I guess I can not say:
apachectl -f /tmp/httpd.conf.test

or the following for that matter:

httpd -f /tmp/httpd.conf.test which actually starts
a daemon which I do not want to happen....

So how else can I check the syntax of a test stand-alone
config file ....?

Thanks,
Farid
UNM



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org