Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Apache RAM usage increasing when viewing pages
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Apache RAM usage increasing when viewing pages

Hi everyone I'm kinda stumped here. I have a VPS with ramnode that runs a website for a client of mine. The site is based on wordpress multisite and uses a couple of plugins. When I first start apache the server's RAM usage is about 21MB, but loading a single page causes it to jump to 118MB. Going to a different page causes it to increase instantly to over 200MB. Each time this happens a new process is spawned that uses about 20% of RAM.

I'm no stranger to the web or servers in general. I have a couple other VPSs from RamNode one of them running all kinds of other things like Wordpress, web rss readers, random php applications, etc.. and I have never had a problem with RAM usage. I also have dozens of other VMs on in house virtualization servers some of which are running apache, and still have yet to have a problem.

I have tried disabling and deleting all the plugins that I can spare with no such luck. I don't know if there is way to see what about wordpress is causing so much RAM usage. If there is a way I haven't been able to find it.

So this is really puzzling to me and I can't seem to figure out why its behaving this way. I have looked at this thread
http://lowendtalk.com/discussion/5587/solved-apache-ram-usage-increasing-with-time
with no luck.

Any help with this would greatly be appreciated.

Thanks,
CFarence

Comments

  • What does your stack look like? Are you using mod_php or php-fpm with fastcgi? How are you getting the memory usage numbers? This could just be the filesystem cache if you're looking at free. More info would be helpful.

  • @amhoab said:
    What does your stack look like? Are you using mod_php or php-fpm with fastcgi? How are you getting the memory usage numbers? This could just be the filesystem cache if you're looking at free. More info would be helpful.

    I'm using mod_php and I got the ram usage from htop. Free says I'm using 176MB while htop says 159MB.

  • most of the time it is caching . are you using multi processing modules? If you do not need very advanced features of apache consider moving to more lightweight nginx or lighttpd

  • khavkhav Member

    Nginx + PHP-FPM really rocks in terms of performance

    I use it on all my sites , i ditched apache long back

  • drop apache, and start to using nginx + php-fpm.
    It's hard to do at first time, but in future you will get a big win in hardware resource economy.

  • neqste said: nginx + php-fpm. It's hard to do at first time

    I wanted to use nginx + php-fpm but couldn't get it setup properly, which is why I stuck with apache. Is there any good guides out there. I found a few when I was first starting but got stuck with the php part of it.

  • said: wordpress multisite and uses a couple of plugins

    This might be the problem, check if the plugins are properly written by competent developers.

    CFarence said: I wanted to use nginx + php-fpm but couldn't get it setup properly, which is why I stuck with apache. Is there any good guides out there.

    Install VestaCP, they have Apache + nginx as reverse proxy and soon, they'll have nginx + php-fpm

  • @GIANT_CRAB said:
    Install VestaCP, they have Apache + nginx as reverse proxy and soon, they'll have nginx + php-fpm

    I've seen VestaCP and it looks very nice. Do they have an estimate of when nginx + php-fpm will be done?

  • My guess, around June 23.

  • MuZoMuZo Member

    CFarence said: I've seen VestaCP and it looks very nice. Do they have an estimate of when nginx + php-fpm will be done?

    https://vestacp.com/roadmap/

    Version 0.9.9-1

    Nginx + PHP-FPM (Apache-less configuration support)

    The release is sceduled on June 23.

  • If the problem is with PHP using too much memory and you're using mod_php, switching to nginx and php-fpm will probably not make things better, maybe even make things worse. See articles like this and this one. mod_php is much better than php-fpm, but nginx rocks when it comes to handling requests and serving static content like images, javascript, css etc.

    the best thing to do if you have... I would say 512MB+ RAM is to have nginx listening on port 80 and serving all static content, then backproxying all PHP (and other dynamic content) through apache on 8080, as Vesta CP currently does. PHP-FPM and nginx could be useful for small sites or very low ram boxes with little traffic but you're probably not going to see better performance by switching to nginx for wordpress with plugins.

    There's a guide here on DigitalOcean to get you started if you're interested.

  • I just wrote an article How to install LEMP server with Linux, Nginx, PHP-FPM, and MySQL on Centos if its gonna help you http://namhuy.net/2768/how-to-install-lemp-server-with-linux-nginx-php-fpm-and-mysql-on-centos.html

Sign In or Register to comment.