The MU forums have moved to WordPress.org

MU Ram Usage (27 posts)

  1. jackson100
    Member
    Posted 13 years ago #

    Hi guys, wanted to ask you about your usual ram usage by wpmu, mine went up to 1.9 Gb with about 300 people on the website + super cache enabled...i wonder if you think this is fine or too much?

    are there any ways of reducing the load?

    tnx.

  2. Ovidiu
    Member
    Posted 13 years ago #

    well, that depends on what server you run, I guess its linux running apache :-) so have a look at what apache modules are loaded maybe skip a few you don't need, have a look at running processes you don't need, etc....

  3. andrea_r
    Moderator
    Posted 13 years ago #

    ... have a look at what plugins are in the mu-plugins folder... check and see if the system is being pounded by spam...

    Yeah, that's high.

  4. buzz_lightyear
    Member
    Posted 13 years ago #

    andrea, could you please give me some example of resource usage from some of your wpmu installs?

    many thanxs
    buzz

  5. andrea_r
    Moderator
    Posted 13 years ago #

    The box that gets over a million hits a month is on an account with less than a gig of ram. 768 I think, and there's a handful of other accounts too.

    On another setup, 2-6 blogs get heavy traffic (50K / day) and had to be moved off a grid server onto dedicated.

    And on some hosts the OS counts in the memory/cpu usage. Set up a bare box with 256 megs of RAM, then install Apache, php, mysql, get DNS and mailserver running, some sort of web-based admin, and there's not much left for MU. It'll slow to a crawl before any users or hits on a naked install.

    Even with caching, some hits are going to be dynamic, and that means CPU / memory / mysql processing.

    That's about as much as I can tell ya in public. :) But other than that, I'm gonna play with soem alternate setups (litespeed, ngix) before the end of the year I hope.

  6. andrewbillits
    Member
    Posted 13 years ago #

    We tried litespeed for Edublogs but ended up switching back to apache. It was just one problem after another with litespeed.

    Thanks,
    Andrew

  7. buzz_lightyear
    Member
    Posted 13 years ago #

    @andrea
    thanx 4 info.. very helpful...

    buzz

  8. tdjcbe
    Member
    Posted 13 years ago #

    If you're using a hosting panel like CPanel, Direct Admin, etc., you may want to consider turning it off as it uses memory as well. Granted that's not the cause of your issue but freeing up some memory may be helpful to you.

  9. josswinn
    Member
    Posted 13 years ago #

    My RedHat VMWare machine (hosted where I work) uses about 2.2GB RAM including the OS, running apache, MySQL, sendmail and Trac. No xserver. There are a few vhosts and WPMU running. Hardly any traffic at the moment as most of the sites are new and experimental with just a few users. Load testing it pushes it to about 2.7GB of RAM usage with my current apache config.

    Seems high.

  10. tdjcbe
    Member
    Posted 13 years ago #

    Really wish someone would do a top or some debugging to see what's using up the memory.

  11. josswinn
    Member
    Posted 13 years ago #

    On my machine it's apache and mysql that rank highest. mysql sits around first or second highest on memory usage.120 user accounts and about 50 blogs, but barely any usage at the moment. If a blog gets 20 unique visits in a day, that's 'busy'. I'll maybe post more detail tomorrow when I get to work and have the figures to look at.

  12. andrea_r
    Moderator
    Posted 13 years ago #

    Just for giggles:

    top - 16:11:15 up 33 days, 9:17, 1 user, load average: 0.75, 0.50, 0.39
    Tasks: 56 total, 1 running, 53 sleeping, 0 stopped, 2 zombie
    Cpu(s): 0.0% us, 0.1% sy, 1.0% ni, 96.4% id, 2.5% wa, 0.0% hi, 0.0% si
    Mem: 786432k total, 271836k used, 514596k free, 0k buffers
    Swap: 0k total, 0k used, 0k free, 0k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    27699 nobody 19 4 27828 15m 3348 S 7 2.0 0:01.45 httpd
    6025 nobody 19 4 29576 16m 3372 S 7 2.2 0:04.47 httpd
    24476 nobody 19 4 29512 16m 3364 S 7 2.2 0:01.64 httpd
    15608 nobody 19 4 30812 18m 3440 S 6 2.4 0:02.58 httpd
    27700 nobody 19 4 29956 17m 3348 S 6 2.2 0:01.30 httpd
    9866 mysql 22 6 61632 32m 2748 S 2 4.2 997:09.85 mysqld
    24312 nobody 19 4 31812 18m 3868 S 1 2.4 0:04.45 httpd
    1 root 16 0 1980 624 536 S 0 0.1 0:27.37 init
    7202 root 15 0 1644 564 472 S 0 0.1 1:36.08 syslogd
    7207 root 16 0 1588 400 336 S 0 0.1 1:00.42 klogd
    7214 root 16 0 1568 400 336 S 0 0.1 0:00.00 courierlogger
    7215 root 16 0 1928 612 508 S 0 0.1 0:00.20 authdaemond
    7230 root 16 0 1928 384 268 S 0 0.0 0:01.88 authdaemond
    7231 root 16 0 1928 384 268 S 0 0.0 0:01.70 authdaemond
    9721 root 16 0 6908 1028 652 S 0 0.1 0:13.48 sshd
    9759 root 17 0 2368 1124 972 S 0 0.1 0:00.00 mysqld_safe
    10046 root 17 0 4624 2988 1248 S 0 0.4 1:02.51 chkservd

    MySQL is running at about 4% of the memory, Apache collectively over 14%. There's one busy WPMU install on this VPS, hit 32,676 times today so far. Double that yesterday. 60 blogs were active in the last week.

    There's 5 other single WP blogs on the same VPS in their own account, a small number of hosted sites and a few in development. Even when I had the test buddypress install in the same space, it still held. (mind you, most people just signed up & poked around. tons of users, little actual activity.)

  13. Ovidiu
    Member
    Posted 13 years ago #

    you have to be careful when talking about memory usage, linux tends to use all available memory but that is not all "used", most of the memory will be shared, buffered or cached.

  14. josswinn
    Member
    Posted 13 years ago #

    A bit of fun...

    I've just been going through all the running services on my machine and realised I could turn quite a lot off. On a fresh boot now, it uses about 750MB of RAM (including the OS - that's *all* running processes) and having just tested it with 'ab -n 1000 -c 100 http://my.server.url/test.html' the CPU only went up to around 30% and memory usage didn't climb above 1.2GB, coming back down to 700MB soon after. That's just a flat file, of course.

    Running JMeter as 100 simultaneous users hitting the actual front page of the site, sent CPU to over 80% and RAM usage peaked at 2.2GB. Following that, the machine came back down gracefully to about 900MB of RAM usage.

    The only caching I have set up is eAccelerator, which caches PHP requests.

    Currently, the relevant part of my http.conf looks like this:

    Timeout 45
    KeepAlive Off
    MaxKeepAliveRequests 100
    KeepAliveTimeout 5

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

    Cheers
    Joss

  15. lunabyte
    Member
    Posted 13 years ago #

    I notice you mention eAccelerator. You may wish to consider APC or xCache as they provide better performance, in that order.

    One positive to APC is that it's an official PHP project, so compatibility between PHP upgrades and such would be less of a worry. For xCache, it's a tick faster, and really nice as well.

    In terms of eAccelerator, it's better than nothing at all of course, and your particular server situation and mileage may vary.

  16. jackson100
    Member
    Posted 13 years ago #

    2 josswinn: thats a great improvement...can you please share what kind of things you turned off so that you now have 750mb used instead of 2.2Gb.

    2 andrea_r: I see your "Top" but it looks like there is a difference between a VPS and a Dedicated ram usage...while I had VPS our ram usage was also somewhere around 300 Mb (30 - 100k hits a day on a single wordpress install) but now with a dedicated the ram usage is much higher...i believe when u r on VPS, the linux ram consumption is not relevant and is not shown and is not included in your "top" statistics while with a dedicated it is...

  17. andrea_r
    Moderator
    Posted 13 years ago #

    Depends on the VPS host. :)

    FWIW, my local box is Linux, and it runs similar to what josswin above is seeing.

  18. josswinn
    Member
    Posted 13 years ago #

    @ jackson100 Nothing remarkable to report, really.

    When the box was first set up, it had a Gnome desktop installed for occasional VNC use. Actually stripping all of the desktop environment and related services from the box improved things the most. It wasn't enough just to shut the x-server down - services like cups and xfs run independently of it. So removing all of that made the biggest difference for me.

    I also ran 'chkconfig --list |grep 3:on' to see what services were being turned on at boot time and found I could remove a few of those. Being inside of a firewalled environment at work, running on VMWare, with someone else taking care of the whole virtualisation of servers, meant there were some services that were running by default on a server environment but I didn't require. Samba and NFS are two examples of this.

    You get the picture. The box was set up with way too many services running and I'd not gotten around to stripping them back until yesterday. This morning when I got to work, top shows it's using 2GB of RAM, rather than 700-900MB. MySQL is using a chunk of memory. A reboot has brought it down to less than 500MB of RAM being used. I'm pleased to have a machine with 3GB RAM installed, but I'm not using it constantly as I was before.

  19. josswinn
    Member
    Posted 13 years ago #

    @ovidiu yes, you're right about Linux using memory for sharing, caching and buffering. In practice though, if my RAM usage does show high, it does tend to indicate that I'm running out of resources, which I can see as use of swap kicks in and things start to grind to a halt.

  20. Ovidiu
    Member
    Posted 13 years ago #

    @josswin: I should have expected you to know that but I have seen users switching from windows to linux complaining about high RAM usage :-) so I thought I'd mention it.

    Besides, go check for some apache tuning sites, there are lots of useful resources out there, giving hints and explaining all those settings you posted above. Also check for mysql tuning, thats another important factor and you have to make sure your apache and mysql configs do work hand in hand, i.e. whats the use of having maxclients in apache set to 256 when the max-mysql-connections is set to 128 :-) (while I can't remember that value's real name but you get the point...

  21. josswinn
    Member
    Posted 13 years ago #

    @lunabyte Thanks for pointing me to APC and xCache. In the near future, my current experimental WPMU install will be replaced with a more permanent install for much wider use and that move will be a good time to test other caching tools.

    eAccelerator seems stable, was very easy to set up and has noticeably improved page rendering time (I've not actually benchmarked anything though).

    I prefer this method of caching over using wp-super-cache. It seems less intrusive, works across all applications on the server and is invisible to users. I follow wp-super-cache releases with interest though.

    Is anyone else using wp-super-cache on a WPMU install? Any thoughts?

  22. josswinn
    Member
    Posted 13 years ago #

    @ovidiu Thanks for reminding me. I've completely ignored mysql optimisation up to now.

  23. jackson100
    Member
    Posted 13 years ago #

    we do use wp-super-cache, however, it does not seem to reduce the server load that much - it looks to me, that compiling the php files is currently not the biggest issue on our, quite a powerful, server because with either wp-super-cache turned off or on we get approx. similar ram/cpu usage but it looks to me that the .js scripts are quite an overhead...and im thinking of moving them somewhere else...

  24. jackson100
    Member
    Posted 13 years ago #

    + having about 39 plugins in mu-plugins directory might also be an issue for us...

  25. andrea_r
    Moderator
    Posted 13 years ago #

    Yeah, that would do it. Especially if there's a poorly-written one in there.

  26. tdjcbe
    Member
    Posted 13 years ago #

    All those dang widget files. :)

    I have on my todo list what edublogs does with theirs: Take their extra installed widgets, combine them all into a single file, move them over to the plugins directory, give it a label of "Extra Widgets" and let folks turn them on themselves if they want them. Probably won't do it for all of them but I'll probably go through and figure out which ones get used the least.

  27. Bike
    Member
    Posted 13 years ago #

    Disabling Clam AV freed up about 200mb ram, which was quite a lot on a 512mb box ;)

    Make sure it is fully disabled, so it does not reinstall. This happened to me, but I asked my host to fix it once and for all and that helped..

    Cheers,
    Bike

About this Topic