logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache 2.2.21 - Memory leak on new client connections
Author
markw



Joined: 24 Nov 2011
Posts: 7
Location: UK

PostPosted: Thu 24 Nov '11 12:53    Post subject: Apache 2.2.21 - Memory leak on new client connections Reply with quote

Hello all,

I've got a bit of an odd problem I'm hoping someone can offer advice for. I've downloaded and installed httpd-2.2.21-win32-x86-ssl.zip (10 Sep '11) from the downloads section, and the host is running on Windows Server 2003 R2.

After much poking around with JMeter and Process Explorer on our test server, and making observations on our live server I've noticed that the httpd.exe worker process is using more memory for every client that connects. Here are the stats for just Apache without any extras installed:

Clients - Private Bytes - Working Set
0 - 22,296K - 19,024K
1 - 22,424K - 19,192K
2 - 22,556K - 19,316K
3 - 22,684K - 19,444K
20 - 24,364K - 20,968K

I've then watched the memory usage over the next hour or so and seen no decrease, so the additional memory being allocated never gets cleaned up. When using Apache with PHP (but not loading a PHP page) the problem is more pronounced

Clients - Private Bytes - Working Set
0 - 32,760K - 31,948K
1 - 33,932K - 32,752K
2 - 35,084K - 33,504K
3 - 36,084K - 34,260K

And again, this can be left all night and the memory usage will not decrease.

Looking around I haven't found anyone else experiencing these issues with the build I downloaded, but I am confident there wasn't a problem with the download as it passed a hash check. Is there maybe something in the conf that could cause this problem, or maybe something to do with my host machine's configuration? Any ideas would be appreciated.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3093
Location: Hilversum, NL, EU

PostPosted: Thu 24 Nov '11 13:20    Post subject: Reply with quote

Every connection needs some, and there can be some leak. Here at AL when Apache is started the usage is about 30 meg it's growing first a little fast and more in time it goes not so fast and stabilize after time at ~100 meg. With Apache 2.4 it looks better, cleaning up in some area's has redone.

Maybe you can look with Server Status how long connections stays and get some more insight, see http://httpd.apache.org/docs/2.2/mod/mod_status.html

Steffen
Back to top
markw



Joined: 24 Nov 2011
Posts: 7
Location: UK

PostPosted: Mon 28 Nov '11 11:26    Post subject: Reply with quote

Steffen wrote:
Every connection needs some, and there can be some leak. Here at AL when Apache is started the usage is about 30 meg it's growing first a little fast and more in time it goes not so fast and stabilize after time at ~100 meg. With Apache 2.4 it looks better, cleaning up in some area's has redone.


OK that's good to know, means I don't need to worry about it.

Quote:
Maybe you can look with Server Status how long connections stays and get some more insight, see http://httpd.apache.org/docs/2.2/mod/mod_status.html

Steffen


That has helped a lot thanks. I'm now finding that when running with PHP and under heavy usage the httpd.exe worker process will occasionally stop responding all together for many minutes before finally crashing and restarting.

Having the server unavailable for this period of time is really not acceptable but I cannot find a cause because Apache just reports it is crashing with status 1 or status 3221225477 and the system log shows that Apache has been crashed by faulting module php5ts.dll. As the seemingly guilty party in all of this PHP says nothing at all of course :S.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3093
Location: Hilversum, NL, EU

PostPosted: Mon 28 Nov '11 12:15    Post subject: Reply with quote

When running php as module, quite some issues you have, are reported here in the forum. A lot of them are switching to run php with FastCGI (mod_fcgid).

Steffen
Back to top
Smitty



Joined: 03 Jan 2008
Posts: 197

PostPosted: Mon 28 Nov '11 15:06    Post subject: Reply with quote

Steffen is correct.

We tried running PHP 5.3.x using the PHP module for 2 months and couldn't get it stable. Constant php5ts.dll crashes. As soon as we switched to mod_fcgid (using PHP NTS which has no php5ts.dll) everything has been very stable.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Tue 29 Nov '11 15:51    Post subject: Reply with quote

Could you figure out which extension causes the crash?

I just mean a "thread safe" version should not crash apache Wink And it would be great to create a bug repor for that.
Back to top
Smitty



Joined: 03 Jan 2008
Posts: 197

PostPosted: Tue 29 Nov '11 21:23    Post subject: Reply with quote

No, we never could figure it out. We used just the extensions required to run Moodle:

extension=php_curl.dll
extension=php_gd2.dll
extension=php_intl.dll
extension=php_mbstring.dll
extension=php_mysqli.dll
extension=php_openssl.dll
extension=php_soap.dll
extension=php_xmlrpc.dll

The rest of the required extensions are part of core PHP 5.3.x.

We never had any crashes using PHP 5.2.x with the PHP module. PHP 5.3.x was incredibly unstable until the mod_fcgid switch.
Back to top
markw



Joined: 24 Nov 2011
Posts: 7
Location: UK

PostPosted: Wed 30 Nov '11 11:19    Post subject: Reply with quote

I don't think it is an extension problem; we've tested with other PHP sites on the same server and we don't get a problem, but as soon as I point JMeter to a vanilla version of Moodle I get these crashes. Incidentally Moodle 2.1 seems to suffer from fewer crashes but it isn't "fixed".

Anyways, thanks for your advice everyone, we switched over to FCGI and the server has been much more reliable since.
Back to top


Reply to topic   Topic: Apache 2.2.21 - Memory leak on new client connections View previous topic :: View next topic
Post new topic   Forum Index -> Apache