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: httpd.exe using lot of Memory on Windows
Author
snitin



Joined: 14 Mar 2014
Posts: 7
Location: Italy

PostPosted: Wed 16 Apr '14 10:55    Post subject: httpd.exe using lot of Memory on Windows Reply with quote

We are running an application which uses Apache 2.2.22 as a WebServer on Windows Server 2008 R2 Enterprise.

Looking at the httpd.exe child process in Process Explorer, we see the Private Bytes increasing by 60 MB every day.

This makes it mandatory to restart Apache every 9 working days when Apache hits at it's peak of around 1.2 GB.

Server-status shows:


Total accesses: 1042790 - Total Traffic: 552.1 GB
3.2 requests/sec - 1.7 MB/second - 0.5 MB/request
90 requests currently being processed, 510 idle workers

_______K__________________K_____K__K________K______________K____
_KK__K_K_____K_KR________KK____________________K____K___K_______
__K_K_______K______K___K_K__K__K____K___________K_______________
________________________R__KK_K__K____R_K_____________KK____KKK_
___K__K____________K_____K_______________________KKK____W_______
__K_K______K_KK_______________K_K__K_______K_____R___K__________
_______K____K_______K_____W________K__K_K____K_____________K____
_K________KR________K__K______K_____K_________KK______________K_
_______WK____________KK_K_K____________KK_____________K__K______
________________K_K_____........................................
................................................................


Hardware:

Intel(R) Xeon(R) CPU E5-2609 @2.40 GHz (2 processors)
RAM: 128 GB

httpd.conf:

KeepAliveTimeout 60
SendBufferSize 16384
Timeout 900
ThreadsPerChild 600


We did ran Apache Benchmark tool on some urls (urls from application and also Apache index.html). However we dint observed any memory increase.

We thought of using MaxRequestsPerChild, but since it's a Windows machine, with one child process, it will cause Apache to restart.

The server is a Production server and used 24 x 7. I would like to understand how can I reproduce the memory increase on exactly similar cloned TEST environment. What are the factors which can impact the memory?

I already have a TEST environment, with the only difference of load and usage.

I will also appreciate if I can get any pointer to identify what is taking this memory on windows and where to look at?

Thanks,
Nitin
Back to top
Steffen
Moderator


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

PostPosted: Wed 16 Apr '14 11:09    Post subject: Reply with quote

Quit some "K".

You have :
KeepAliveTimeout 60
Timeout 900

That's quite high and makes mostly no sense, typical values are :

KeepAliveTimeout 15
Timeout 300

You run php as module ? If so, then it is common that it eats memory and you should consider mod_fcgid.

Are you using thirs-party modules, like mod_security ?

You can also try 2.4, has improvements in this area.
Back to top
Steffen
Moderator


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

PostPosted: Wed 16 Apr '14 11:46    Post subject: Reply with quote

I saw you posted a leak issue before: http://www.apachelounge.com/viewtopic.php?t=5863

You say there it is solved, ldap cause.

?
Back to top
snitin



Joined: 14 Mar 2014
Posts: 7
Location: Italy

PostPosted: Wed 16 Apr '14 12:55    Post subject: Reply with quote

Hello Steffen,

The leak issue I posted earlier was on different machines with different server and application instances. Fortunately in that case I could use ab to reproduce memory increase.

That issue infact was caused by incorrect node pointed by AuthLDAPURL. I rectified it to point out to correct node and it was solved.

However the Production version is correct.

We are not running php as module.
We are also not using any third party module.

I will do some checks on KeepAliveTimeOut and Timeout. These were the values suggested by our Application vendor.

However I did noticed 3 modules which I am not very much sure about. I will have to check these.

LoadModule cgi_module modules/mod_cgi.so

LoadModule authz_default_module modules/mod_authz_default.so

LoadModule authz_groupfile_module modules/mod_authz_groupfile.so

LoadModule authz_user_module modules/mod_authz_user.so

Unfortunately I can't try 2.4 because that version is not supported by the Vendor of the application I am running.

Thanks,
Nitin
Back to top
snitin



Joined: 14 Mar 2014
Posts: 7
Location: Italy

PostPosted: Wed 16 Apr '14 13:16    Post subject: httpd.exe using lot of Memory on Windows Reply with quote

Ok.

I understand why mod_authz_default, mod_authz_group_file and mod_authz_user are enabled.

Continuing my tests..

Thanks,
Nitin
Back to top
snitin



Joined: 14 Mar 2014
Posts: 7
Location: Italy

PostPosted: Tue 22 Apr '14 11:55    Post subject: httpd.exe using lot of Memory on Windows Reply with quote

I did some more tests.

I ran the ab tool with different application urls, but that didn't showed any substantial increase. Also most of the times, the behavior regarding memory increase was not consistent with ab tool.

However then I ran ab tool on apache's index.html with three new users through a batch script. I see some spurt in memory.
Then I again ran the ab tool but this time with other three newly created users. I see the memory increatse.
I repeated the test for three more new users and ola..I again see.


Thanks,
Nitin
Back to top


Reply to topic   Topic: httpd.exe using lot of Memory on Windows View previous topic :: View next topic
Post new topic   Forum Index -> Apache