The MU forums have moved to WordPress.org

Possible Memory Bug? (23 posts)

  1. mufasa
    Member
    Posted 16 years ago #

    We just moved a new MPMU site to Slicehost and it seems pretty good.

    Last night though I got an automated email from Slicehost saying that I have having memory issues:

    This is an automatic notification to let you know that your slice is showing a considerable amount of consistent swapping activity. Quite often this is an indicator that your application or database are not as efficient as they could be. It also may indicate that you need to upgrade your slice for more RAM.

    We are using a vanilla WordPress MU 1.5.1 install on a Centos build. And the very scary thing is that we were not even taking hits at the time.

    I think that the Slicehost automated service may have just identified a memory leak / problem with WPMU?

    If there is a master MU guru out there that wants to take a look at this for us I'd really appreciate it.

    Ciao,

    Dan

  2. andrewbillits
    Member
    Posted 16 years ago #

    How much RAM do you have available?

    Thanks,
    Andrew

  3. honewatson
    Member
    Posted 16 years ago #

    I doubt there is a memory leak. Instead you probably lack enough ram for your current set up.

    If cost and resources are an issue when it comes to hosting then I recommend that you do the following things.

    Use Debian/Ubuntu because Cent OS takes up a significant amount of additional ram on a vps.

    The additional ram freed up by using Debian or Ubuntu can be allocated to mysql, or php/cache.

    Use Nginx because it uses much less resources than Apache.

    Once again the additional ram you free up by using Nginx instead of Apache will allow you to allocate more ram to mysql or php/cache.

    Install php5 with php-fpm for fastcgi php and also install xcache.

  4. mufasa
    Member
    Posted 16 years ago #

    We have 512megs of RAM.

    It is strange though because the site was not even being hit... does that not seem strange?

    I would check out these options first though before going to Debian/Ubuntu though:

    Install php5 with php-fpm for fastcgi php and also install xcache.

    Or do you honestly think it is worth just rebuilding a Debian server.

  5. honewatson
    Member
    Posted 16 years ago #

    Absolutely its worth building a Debian/Ubuntu server with Nginx.

    My base install ram with Cent OS and Apache was around 280 megs. Thats before traffic even started hitting my box.

    With Ubuntu and Nginx it was around 86 megs.

    That's almost an extra 200 megs of ram freed up which can now be used for mysql and php cache.

    That's a big difference when you only have 512 megs of ram.

  6. mufasa
    Member
    Posted 16 years ago #

    Thanks for the advice - I am starting to think that we might not have any other options.

    The other thing we've noticed though is that with each page load the memory usage goes up by 20MB - and it never goes back down.

    Is it possible then that there is actually a problem with WordPress MU.... the RAM usage should go back down????

    If you think about it. And the RAM does not go back down it wont matter if I have 512MB RAM or 5000MB of RAM because it will only be a matter of time before that threshold is reached?

  7. honewatson
    Member
    Posted 16 years ago #

    I don't see anyone else here complaining of a memory leak problem, therefore it is your setup. The sooner you change from red hat/apache to debian/nginx the better it will be for you.

    Think about it.

    If you stick to your current setup with unnecessarily high overheads your problems will multiply as your site grows therefore it is better to change now.

  8. mufasa
    Member
    Posted 16 years ago #

    I wonder if that means there is a problem with centOS then?

    For what its worth. I think I'll rebuild my Slice tomorrow morning and use Debian instead. I am also considering using Amazon S3 to host the theme files - using the themes-s3 plugin.

    I think that anything I can do to improve performance must be a good thing right.

  9. Trent
    Member
    Posted 16 years ago #

    Being honest, I have Centos5 and don't have any issues at all let alone even getting close to using my RAM up. I started off with 256 M and that wasn't enough, but 512 M was fine. I did move up to 1 Gig of dedicated RAM but it was humming along fine with 512 M. It still must be the setup because many others run on Media Temple as well without losing with memory leaks (on on CentOS5)

    Trent

  10. andrea_r
    Moderator
    Posted 16 years ago #

    Yeah, I'm kinda scratching my head too. I have Centos too. The only time I had an issue with excessive memory on a live user-filled site with around 512 mem, was what turned out to be a hardware failure.

  11. andrewbillits
    Member
    Posted 16 years ago #

    I'm with Trent and Andrea, I'm not so sure it's CentOS. At the moment all of our edublogs servers are running CentOS. We haven't had a bit of trouble with it.

    Thanks,
    Andrew

  12. lunabyte
    Member
    Posted 16 years ago #

    I'm running C5 in production as well. Not a problem out of it at all.

    Are you serving mail through that as well? Running cPanel/WHM maybe?

    I will note that cpanel/whm will eat a bit, and spam assassin can easily kill a server trying to run mail, web, db, etc. all at once.

    For mail filtering, you can't beat ASSP. Low resource usage, make that VERY low, yet all (and more) the protection of spam assassin.

  13. tdjcbe
    Member
    Posted 16 years ago #

    You may want to ssh into your site and do a 'top' command to see what is using all of the memory.

  14. honewatson
    Member
    Posted 16 years ago #

    All I can say to those who are scratching their heads over my comments on CentOs is... if its working for you that's great.

    I've yet to come across anyone who has swapped to a debian based server who hasn't noticed extra resources freed up and even ubuntu frees up additional significant resources.

    Why buy additional ram or upgrade your hardware when you can simply change your os and software?

  15. mufasa
    Member
    Posted 16 years ago #

    I totally agree with your last comment :P

    Is it hard to get Nginx to work with WordPress MU? Do you have to do anything tricky to get it to play nice with PHP and MySQL or will it just work?

    The only thing that we have done that is not "default" is install two libraries - GD and mCrypt and these need to work for our site to work. Perhaps these are leaking memory in CentOS.

    Anyway it is very encouraging to see that http://www.wordpress.com uses Nginx and host there images on S3. I was wondering what linux distro http://www.wordpress.com uses? Does anybody know?

  16. lunabyte
    Member
    Posted 16 years ago #

    IIRC, wp.com uses Debian and Nginx, but don't hold me to it. I read it somewhere.

    I won't disagree watson, it is quite true. LiteSpeed is a vast improvement over apache as well. Granted, that one costs a bit to go with. It is a nice system though.

    I wonder why (assuming what I read was true) they dumped LSWS for Nginx? Cost? License? I will note that you can't serve pRon with LSWS. Yeah, that's probably it. :D

  17. honewatson
    Member
    Posted 16 years ago #

    I am just about finishing writing a script that will install everything you need on a base install of ubuntu server. I was writing this for my own purposes but if any one is interested I can share.

    The script will install:

    • Nginx with Gzip Compression and SSL support
    • Php-Fpm fastcgi
    • xCache
    • All relevant Php libraries
    • MySql
    • Mu with SuperCache Sub Domain Nginx Config
    • Mu with SuperCache Sub Directories Nginx Config
    • phpmyadmin on ssl Nginx Config
    • postfix with ssl relay

    Also in the works is a one click image of the above on ec2.

    To choose sub domain or sub directory install you will simply hash out the one you don't want in the nginx config file.

    Here is a recent test by a russian guy.

    At VPS selects test configuration,

    goal - optimization flow memory.

    ab -n 10000 -c 4 http://test.******.ru/

    256meg ram with low end processor, the script 10-12 makes requests for reading and 3 on Mysql-Innodb Record to Mysql-Innodb located at the same server.

    apache2+mod_php = 11 req/sec
    nginx+php-fcgi+spawn_fcgi = 16 req/sec
    apache2+mod_php+xcache = 40 req/sec
    nginx+php-fcgi+xcache+spawn_fcgi = 55 req/sec
    nginx+php-fcgi+xcache+php-fpm = 155 req/sec !!!!!!!!!

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    14067 root 16 0 26824 3388 1372 S 0 1.3 0:00.57 php-cgi-fcgi
    16283 alex 16 0 27600 5884 3004 S 0 2.2 0:10.81 php-cgi-fcgi
    22353 alex 15 0 27600 5896 3008 S 0 2.2 0:09.45 php-cgi-fcgi
    27822 alex 16 0 27600 5904 3016 S 0 2.3 0:12.00 php-cgi-fcgi

    apparently, and memory for each is as fcgi at least two times lower than the mod_php + apache

  18. honewatson
    Member
    Posted 16 years ago #

    @lunabyte, I know they are using nginx on the front end proxy but I'm unsure of the rest of their set up.

    Apparently one reason they swapped was to be more inline with their open source philosophy.

    Nginx is at least as fast as LiteSpeed I would say anyway.

  19. mufasa
    Member
    Posted 16 years ago #

    @honewatson, yes please I would love to check out your script. My email address is dan@instinct.co.nz

    Do you guys think that we should try and use Nginx as a proxy or do you think that we should use it as a webserver.

    From what we're reading it might be hard to use it with PHP - can I skype you or something?

  20. honewatson
    Member
    Posted 16 years ago #

    I have a few more changes to make but will send it soon. It's super easy to use nginx with php and its got far superior performance than apache mod php. Just use Nginx as the main server and forget apache.

  21. jonathannelson
    Member
    Posted 16 years ago #

    @honewatson can you please email me your script too? i'd be forever grateful. thanks

    jonathannelson at yahoo dot com

  22. richs0914
    Member
    Posted 15 years ago #

    @honewatson I would also be grateful if you could send me your script.

    richs0914 at yahoo dot com
    richs0914@yahoo.com

  23. wessa
    Member
    Posted 15 years ago #

    @honewatson - did you get this script finished? IF so would you be kind enough to email to me also wes.davis@netprophets.com.au

    Much appreciated :-)

About this Topic