Howdy, Stranger!

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


Wordpress & 32MB Of Ram.. -- Assistance? - Page 2
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.

Wordpress & 32MB Of Ram.. -- Assistance?

2»

Comments

  • jcalebjcaleb Member
    edited July 2012

    mysql seems ok. can you run ps_mem.py (www.pixelbeat.org/scripts/ps_mem.py). this will show how much they really eat for each software.

    edit: i believe its php5-fpm eating ram. try decrease memory_limit in php config file.

  • eastoncheastonch Member
    edited July 2012

    @jcaleb

    
    root@my128pro:~# python ps_mem.py
     Private  +   Shared  =  RAM used       Program
    
      4.0 KiB +   7.5 KiB =  11.5 KiB       logger
      4.0 KiB +  17.0 KiB =  21.0 KiB       mysqld_safe
     52.0 KiB +  15.5 KiB =  67.5 KiB       init
     84.0 KiB +  34.0 KiB = 118.0 KiB       cron
     88.0 KiB +  35.5 KiB = 123.5 KiB       exim4
     92.0 KiB +  41.5 KiB = 133.5 KiB       syslogd
    356.0 KiB +  99.5 KiB = 455.5 KiB       ntpd
      1.0 MiB +  98.0 KiB =   1.1 MiB       nginx (2)
      1.0 MiB + 182.0 KiB =   1.2 MiB       bash
      1.7 MiB + 547.0 KiB =   2.3 MiB       sshd (2)
      3.1 MiB +  67.5 KiB =   3.2 MiB       mysqld
     10.5 MiB +  11.8 MiB =  22.3 MiB       php5-fpm (4)
    ---------------------------------
                             31.0 MiB
    =================================
    
    

    After setting memory limit to 16 mb and restarting... (was 128)

    image

    root@my128pro:~# python ps_mem.py
     Private  +   Shared  =  RAM used       Program
    
     84.0 KiB +  46.5 KiB = 130.5 KiB       logger
    164.0 KiB +  63.5 KiB = 227.5 KiB       init
    156.0 KiB +  73.5 KiB = 229.5 KiB       syslogd
    276.0 KiB +  78.0 KiB = 354.0 KiB       cron
    424.0 KiB +  72.5 KiB = 496.5 KiB       exim4
    280.0 KiB + 303.5 KiB = 583.5 KiB       mysqld_safe
    528.0 KiB + 327.0 KiB = 855.0 KiB       bash
    712.0 KiB + 244.5 KiB = 956.5 KiB       ntpd
    876.0 KiB + 695.0 KiB =   1.5 MiB       nginx (2)
      1.7 MiB + 595.0 KiB =   2.3 MiB       sshd (2)
      6.9 MiB + 131.5 KiB =   7.0 MiB       mysqld
     19.0 MiB +  13.1 MiB =  32.1 MiB       php5-fpm (4)
    ---------------------------------
                             46.8 MiB
    =================================
    
  • @eastonch said: here's my new HTOP... Anybody feel like giving me some further optimization? I feel like I could lose fail2ban and go for something more lightweight, not sure though.. thoughts?

    MySQL seems optimized as far as I can go, using it without INNODB and other bloat, used minstall to configure the optimization of it.

    php-fpm: pool chris seems to be using the most out of anything, that's clearly the php service, right?

    If you want to run in 32MB first thing you do is get rid of all non-esential services. So get rid of fail2ban and ntpd (ntpd is no use on an OpenVz box anyway), and anything else that's hiding out of sight in that htop pic :)

    Replace sshd with dropbear.

    Squeeze mysql even more in that lowmem.cnf, e.g.,

    [mysqld]
    key_buffer_size = 512K
    max_connections = 5
    query_cache_size = 1M
    table_open_cache = 64

    Performance will suffer but that's the price you have to pay.

    You have two php-fpm pools: 'chris' and 'www-data'. If 'chris' is serving your website, disable the 'www-data' pool.

    The memory size of the 'chris' php-fpm pool is determined by the size of the PHP scripts running there -- Wordpress. So disable any non-essential features/addons in Wordpress to (try to) slim it down. Restart php-fpm to see if there's difference.

    At the end of the day you'll have to face the fact the 32MB is too little to run a production Wordpress site. Overall, the system mods you make to get it running will negatively affect site performance and vistor experience. The answer is a bigger VPS... or a smaller blog :)

  • jcalebjcaleb Member
    edited July 2012

    try make pm static and pm.start_servers = 1 in php config
    and also make way to remove www-data pool

  • DamianDamian Member

    @BluBoy: What graphing system is that?

    @eastonch: is this OpenVZ? If so, running ntpd won't do much, since containers aren't allowed to set their own times; instead, they inherit the host node's time.

  • PHP-cgi will use less RAM them PHP-fpm

  • BluBoyBluBoy Member

    @Damian said: What graphing system is that?

    It's just RRDTool. I have been playing around with it recently and don't mind the result
    (If you look under the "THRIFTYDEVIL MONITORING" sidebar section on my blog, there are a few other ones I have been trying out).

    https://www.thriftydevil.com.au/

  • Ok, removed some MySQL stuffs, disabled the second pool from the /etc/php5/fpm/pool.d/www-data

    But now I have this...

    Why do i have two pools?
    http://screensnapr.com/e/Yhddf0.png

    Here's my config file for "chriseaston.info" in the pool.d
    http://screensnapr.com/e/MWvwxF.png

    Thanks.

  • Ok, so I gave up on Wordpress, being that MySQL is always going to be a memory chomper...

    FlatPress does everything I need, and it runs it at 17MB, after removal of MySQL.
    Since there's not as much to load, except static pages, the entire PHP-FPM takes much less too.

  • Not two pools, two PHP processes (in the chris pool). With pm = dynamic PHP will spawn additional processes to handle traffic, up to the maximum set by pm.max-children.

  • Static was generating much more processes... Is this normal?

  • yomeroyomero Member
    edited July 2012

    PHP with 128MB or 96MB in the config is ok for wordpress. Just use the ondemand scheduler to free some memory if gets idle. And limit the max children.

    If your server never gets idle, then better to stick with the dynamic, as @sleddog says

  • @Yomero -- I had it running fine, it was just using more than 32MB -- I wanted to limit it as much as possible to install a WP Blog on my 32Mb IPX box :']

  • @eastonch said: FlatPress does everything I need

    I haven't looked at Flatpress for ages. Just googled it now and for flatpress.org I see "This site may be compromised"...?

    https://www.google.com/search?q=FlatPress

  • yomeroyomero Member

    @eastonch said: I wanted to limit it as much as possible to install a WP Blog on my 32Mb IPX box :']

    But is a KVM right? Already uses some RAM for the kernel and so.
    Also, you can periodically purge some hidden caches, google for "drop_caches" and use the value 3.

  • it's not a KVM :'] @Sleddog -- I noticed that too, doesnt pop up when visiting.

    Drop_Cache's wasnt allowed on OVZ, well atleast, this box :S

  • @yomero said: But is a KVM right? Already uses some RAM for the kernel and so.

    Also, you can periodically purge some hidden caches, google for "drop_caches" and use the value 3.

    IPX is OpenVz. For KVM, don't do "drop_caches", it kills the benefit of caching. Better to increase /proc/sys/vm/vfs_cache_pressure, which will cause the kernel to be more agressive in reclaiming memory from cache-usage when more memory is requested.

  • netomxnetomx Moderator, Veteran

    @eastonch said: Ok, so I gave up on Wordpress

    I will try it when I got my 32mb server back XD

  • People have mentioned that using PHP_CGI would be better than FPM. Not sure :/

  • yomeroyomero Member

    @sleddog said: IPX is OpenVz

    Yes, I know. I mean, the current server in question.

    @sleddog said: Better to increase /proc/sys/vm/vfs_cache_pressure

    Interesting. Because the freaking kernel really uses that memory =/

  • @yomero said: Interesting. Because the freaking kernel really uses that memory =/

    Try:

    vm.swappiness = 0
    vm.vfs_cache_pressure = 200

  • yomeroyomero Member

    @sleddog said: vm.swappiness = 0

    That may be overkill :P
    Personally I use "5"

    I will check about the other value. Ty.

  • sleddogsleddog Member
    edited July 2012

    @yomero said: That may be overkill :P

    vm.swappiness = 0 doesn't disable swapping, it just says, "don't do it unless you bloody well have to" :) Newer kernels (3.x) seem to be more swap-happy....

  • yomeroyomero Member

    @sleddog said: "don't do it unless you bloody well have to"

    Agree. But I wonder what values may start to compromise performance

Sign In or Register to comment.