I am facing an issue over the site i am working on, even in very low load of around 10-20 page views per second, the CPU usage maxes out, with all cores running at 100% plus the apache thread memory size keeps on increasing.

We have a server having 4 cores and 34GB as RAM, after some time the memory max out and when i look at apache thread using top command, i can see most of the apache threads in sleep mode but each occupying around 500-600 MB memory.

Its like apache thread is not releasing memory even going into sleep.

  • 1
    what is your question? how do you evaluate memory usage? – GioMac Sep 10 '13 at 11:36
  • By memory here i mean RAM usage - physical memory, I check it with using commands like top and htop, which shows me details and i can see the RES part for apache thread which started from 98M going upto 800M for threads and staying there even the thread is in sleep mode. – Rahul Tyagi Sep 11 '13 at 5:54

CPU load depends on application logic, regarding RAM - RES part is inaccurate and won't show you the real usage of physical memory. I recommend you to test memory with https://raw.github.com/pixelb/ps_mem/master/ps_mem.py and check application logic.

  • When i ran his script it gave me the same picture :see report below 1.9 MiB + 184.5 KiB = 2.1 MiB sendmail-mta 1.9 MiB + 595.5 KiB = 2.4 MiB sshd (2) 1.8 MiB + 1.4 MiB = 3.3 MiB nginx (3) 10.1 MiB + 58.0 KiB = 10.2 MiB screen 20.6 MiB + 1.0 MiB = 21.6 MiB bash (7) 112.2 MiB + 220.5 KiB = 112.5 MiB newrelic-daemon (2) 20.9 GiB + 98.9 MiB = 21.0 GiB apache2 (154) --------------------------------- 21.2 GiB ================================= My apache threads occupying 20GB+ memory.. – Rahul Tyagi Sep 11 '13 at 12:53
  • then you should check your configuration and logic of your application. Still, I don't see the question. – GioMac Sep 11 '13 at 15:46
  • May be this can help you understand what i am asking here, i have a clustered production environment, where as i have a development environment which is a single server environment, this memory issue is not occurring on my development environment. I have same code base plus the same database on dev environment. – Rahul Tyagi Sep 12 '13 at 5:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.