0

I am using httpd with mod jk 1.2.28 on RHEL5. Behind httpd, I do have tomcat running. Connection from httpd to tomcat is made via ajp connector using modjk. I am just load testing the httpd - Using JMeter, when I create 2000 users in 120 seconds from two different JVMs simultaneously, the httpd memory usage goes high and when all the connections are released slowly, the httpd memory release is very slow. Sometime I do need to restart httpd process. When I restart httpd, memory usage immediately goes down. What should I do to speed up httpd memory release without restarting httpd process ? Is there any attribute for achieving this in workers.properties and httpd.conf ?

Please provide some help.

Thanks in advance :)

user1180463
  • 247
  • 11
  • 21
  • Why do you need to restart the httpd process? What happens if you don't? – David Schwartz Oct 04 '12 at 09:55
  • Sometimes it happens, that request is not forwarded to app server. This needs httpd restarts. – user1180463 Oct 04 '12 at 10:01
  • Ahh, so have you done any troubleshooting on the actual problem? Is there anything in the logs? Can you replicate the problem under test conditions? If so, what conditions trigger it? – David Schwartz Oct 04 '12 at 10:22
  • When i do increase the load on the web server, say 2000 users in 120 secs from two machines, the memory usage of httpd is going high (as expected), but when connections are released (netstat shows 0 established tcp connections on port 8009), memory is released very slowly. Also sometimes it is observed, that httpd is not responding and we have to restart httpd which releases memory immediately – user1180463 Oct 04 '12 at 10:30
  • Can you pick one issue or the other? It's very hard to talk about two different things at the same time. We can work on the memory or we can work on the non-responsiveness, but unless you have any reason to think they're related, trying to talk about both at once is going to confuse everyone. Why not focus on the one that's actually causing you problems? – David Schwartz Oct 04 '12 at 10:32
  • Actually, I want that as the connection is released, memory should also be released immediately. This will not cause much memory rise which is the main reason for httpd to become non-responsive – user1180463 Oct 04 '12 at 10:36
  • When you say "memory", do you mean physical memory or virtual memory? Also, how did you establish a connection between non-responsiveness and memory use? Can you replicate the non-responsiveness under test conditions? If so, what conditions trigger it? – David Schwartz Oct 04 '12 at 10:41
  • I mean physical memory. as we are creating a number of connections which consumes a lot of memory, so there is no memory left for the httpd to respond – user1180463 Oct 04 '12 at 10:47
  • If that's your issue, releasing physical memory faster will just make things worse as the process will have less physical memory to work with. Releasing physical memory would either mean the http process has to re-acquire it, making more work, or make do with less memory, making it less efficient. – David Schwartz Oct 04 '12 at 10:59

1 Answers1

0

One interesting observation of mine -

With low value say 200 of maxThread in tomcat server.xml, httpd becomes unresponsive and I need to restart httpd after running my jmeter load test. Memory is not released automatically after the test completes connections on 8009 are CLOSE_WAIT

With high value say 2000 of maxThread in tomcat server.xml, no need to restart httpd after running JMeter load test, As Memory is released automatically after the test completes Connections on 8009 are LAST_ACK

My httpd.conf is as follows. I do not understand which of these two MPMs is used. Accordingly I need to modify MaxClient value. Please help I do not want to restart httpd and I dont want high value for maxThread.

<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  4000
</IfModule>

<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>
user1180463
  • 247
  • 11
  • 21