0

Running apache 2.0 on ubuntu 14.04 (MPM prefork), I'm seeing multiple child workers with variable "RES" megabyte values (as expected). While I have plenty of RAM to handle all of these processes (i.e. optimization at this point to limit the number of workers or specifying the time out, won't make much overall difference), I have a request which I know is very memory demanding. Despite this, the % memory of the server when this request is running never exceeds 24%. Increasing the number of allowed workers increases the % memory used (since more requests are still open) therefore it seems like there's a maximum Mb size for each individual request. Is this possible or am I missing something?

As you can see here: Total memory used, total memory used by apache is 910 mb (out of 1.4 gb allocated to it).

Yet each memory-demanding child is using max 227 mb; which is not enough for each individual process resulting in very long processing times: Bottleneck

UPDATE:

I've realized that I haven't included the whole story here and as it is, it might not be an apache issue per se. I'm using apache with mod_wsgi supporting a flask framework that is in its own virtual environment VirtualEnv python package. Maybe the issue I'm seeing is because the memory is limited for the virtual environment? I've looked this up but doesn't seem like such limit exists; at least not by default.

dter
  • 101
  • 1
  • Are you sure the long processing times are caused by Apache, and not the thread waiting for PHP or something? Do you have any Apache rlimits set? – Jeroen Jun 09 '16 at 12:54
  • I'm using flask and I have a one liner that is quite memory consuming. In fact when triggered/requested, when I had 1GB of memory on my server, it would use all of that so I upgraded to 2GB and this issue happened (i.e. uses only 24% of total memory) and the request is never completed if I set an infinite time out because of this memory bottleneck. If I replace this one liner with a delay instead, memory is not needed anymore and doesn't spike, everything works fine. Except for the number of servers, max children and the sort, I haven't changed any of the default settings. – dter Jun 09 '16 at 13:00
  • Make sure you read http://blog.dscpl.com.au/2012/10/why-are-you-using-embedded-mode-of.html and are not using embedded mode. Try and avoid Apache 2.0, it has memory issues when using older mod_wsgi versions. Latest mod_wsgi include workarounds for Apache design issues that cause the memory problems. In general though, should use Apache 2.4. – Graham Dumpleton Jul 16 '16 at 09:47

0 Answers0