Not signed in (Sign In)
    • CommentAuthorreinier
    • CommentTimeDec 5th 2007 edited
     permalink
    I'm running a 256 slice with 3 wordpress blogs, nothing more. Since yesterday, the slice goes out of memory in 60 minutes, without any increase of visits or change of server configuration. How can I track down the problem? I know how to use top and free, but that doesn't tell me a thing about the cause of the problem (at least, I can't figure it out).

    This is what I see when the server is out of memory (second line)

    Time (GMT) CPU % CPU time Disk read/write Network in/out
    16:47 Wed Dec 05 388 3784s 250049k / 319378k 19639k / 19368k
    16:03 Wed Dec 05 6 89s 22651k / 36264k 8999k / 8035k

    Someone any ideas on this subject? I also got an automatic mail from slicehost with the message that I'm out of swap memory, and links to the top and free pages on the wiki. Like I said before, that doesn't help me track down the problem...
    •  
      CommentAuthorSuperJared
    • CommentTimeDec 5th 2007
     permalink
    I assume you're using Apache/mod_php yes? If so trim down your maxclients and some other similar directives. The default is just too many for a 256 slice.

    You may also consider moving to nginx or lighty.
    Thankful People: reinier, Ricardo
    •  
      CommentAuthorfkumro
    • CommentTimeDec 5th 2007
     permalink
    http://ocaoimh.ie/wp-super-cache/
    -or-
    http://mnm.uib.es/gallir/wp-cache-2/

    Caching will reduce the work needed to be done on the backend and save memory. I would agree with SuperJared about getting away from apache. nginx works great for me!
    • CommentAuthoradam
    • CommentTimeDec 6th 2007
     permalink
    Also read the MySQL Optimization section of http://articles.slicehost.com/2007/11/23/ubuntu-gutsy-mysql-and-ror
    • CommentAuthorreinier
    • CommentTimeDec 7th 2007
     permalink
    Since I downgraded the maxclients, everything works fine again!
    •  
      CommentAuthoraustin
    • CommentTimeMar 19th 2008
     permalink

    I am having the same setup (1 WordPress installation), same trouble.

    What number of maxclients did you set?

    I had 150 which I reduced to 15 -- (is that too few)?

    I would appreciate any advice --

    Thanks

    A U S T I N ,

    Austin Burbridge

    • CommentAuthorsfong15
    • CommentTimeMar 19th 2008
     permalink
    I followed this (sorry not one of slicehost's) http://wiki.vpslink.com/index.php?title=Low_memory_MySQL_/_Apache_configurations and http://emergent.urbanpug.com/?p=60 for mysql

    Before I got my slice I played with a 7 days free trial at 'budget dedicated' I could get LAMP running with 64M. I have 256M slice running 3 blogs with few dozens visits a day without using up all my RAM.
    Thankful People: Ali, bryan, Ricardo, Nodlehs, Feras
  1.  permalink
    Here's what I use on my 256slice, it has no problems with hosting several PHP sites (including a large phpBB forum):

    StartServers 3
    MinSpareServers 3
    MaxSpareServers 3
    ServerLimit 50
    MaxClients 50
    MaxRequestsPerChild 1000
    •  
      CommentAuthoraustin
    • CommentTimeMar 21st 2008
     permalink

    sfong15, AlexExtreme, Thank you very much! You have been very helpful.

    A U S T I N .

    • CommentAuthorBen Atkin
    • CommentTimeSep 4th 2008
     permalink
    Thanks, SuperJared and AlanExtreme, for the information on getting apache2 to use less memory. It was useful to me as well!
  2.  permalink
    Thanks AlexExtreme, those settings made a monumental difference for me. My slice is so much more responsive now. I was pulling my hair out trying to figure what I needed to do to solve my speed issues. I only have a handful of websites and a wordpress install on my slice, but it was running so bad. Thanks again!
    •  
      CommentAuthorFeras
    • CommentTimeFeb 15th 2009 edited
     permalink
    AlexExtreme !! your a Swap Geek xD

    these setting make my 256 Very fast and helpfull !

    i got tonigth a warning in my load & SWAP wondering whats wrong ... when i change the httpd.conf setting now its fixed !

    here is the different hope everyone who didnt make these setting change to change it NOW !

    Load average has crossed the limits...
    Hostname: www.site.com
    Local Date & Time : Sun Feb 15 14:49:08 PST 2009
    | Uptime status: |
    ------------------
    14:49:08 up 5 days, 15:11, 1 user, load average: 10.81, 6.33, 3.50
    ------------------
    | Top 20 CPU consuming processes: |
    USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
    | Top 10 memory-consuming processes: |
    ---------------------------
    | Memory and Swap status: |
    total used free shared buffers cached
    Mem: 256 252 3 0 0 19
    -/+ buffers/cache: 232 24
    Swap: 511 338 173
    ------------------------------
    | Disk Space information: |
    ---------------------------
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda1 9.4G 1.8G 7.2G 20% /
    ------THE END----------------

    see here 330 Mb of swap before the setting

    [root@www b0x]# free -m
    total used free shared buffers cached
    Mem: 256 106 149 0 1 43
    -/+ buffers/cache: 62 193
    Swap: 511 28 483
    [root@www b0x]#

    Now 28 Mb of swap After the setting
    Cheers !
    • CommentAuthorsphinx
    • CommentTimeFeb 24th 2009
     permalink
    AlexExtreme, you are an absolute lifesaver.

    I was running 3 WordPress blogs, one of which is active, and the server was fairly slow, often taking almost 30 seconds to load a single page. I came to the forums looking for a solution, and found yours.

    I have implemented it, and my site loads very quickly, the slowest part now is the Google Analytics code.

    I still have to implement caching, but I wanted to use that as a last resort.
    •  
      CommentAuthorccmehil
    • CommentTimeMar 5th 2009
     permalink
    AlexExtereme, excellent tips! I could actually probably move my app back to a 256MB slice now instead of the 512 I never even hit 200MB anymore thanks to your tips!

    Have any tips for MySQL settings?
  3.  permalink
    I just changed from the default Apache settings to the ones listed above. My new stats are below, but I'm not sure how much better this is than before. Can someone give me a quick analysis?

    13:26 Thu Mar 05 2 24s 3578k / 328k 534k / 843k
    13:25 Thu Mar 05 2 24s 3578k / 328k 533k / 843k
    02:04 Thu Mar 05 3 9003s 158062k / 164557k 65628k / 45346k
    00:26 Thu Mar 05 2 8801s 153752k / 160311k 65495k / 44859k
    00:26 Thu Mar 05 4 8801s 153752k / 160308k 65495k / 44859k
    • CommentAuthorashfame
    • CommentTimeMar 9th 2009
     permalink
    @AlexExtreme
    Thanks for the configuration settings. My RAM usage has dropped to 50%. How come I will know when there will be a need to change (increase) these settings?
    • CommentAuthorAli
    • CommentTimeMar 9th 2009
     permalink
    Thanks for the tips, appreciated. Any tips for tweaking lighttpd?

    PS: This is the second part of the article which sfong15 referred, focused on MySQL optimization; http://emergent.urbanpug.com/?p=61
    • CommentAuthorashfame
    • CommentTimeMar 11th 2009
     permalink
    Again My RAM usage went nuts and Apache freezes up requiring me to hard reboot. I dont get it. What could be the problem?
    •  
      CommentAuthormatiu
    • CommentTimeApr 13th 2009
     permalink

    Here are some more links that I've picked up over time:

    •  
      CommentAuthorhyperial
    • CommentTimeApr 27th 2009
     permalink
    I had a case with one of my customer's blogs where his wp-cron.php was causing massive Apache memory problems and I believe, if I remember correctly, it was one plugin that was using the wp-cron that caused it all. Otherwise, my machine was able to handle many Wordpress blogs without issue.

    Posted By: ashfameAgain My RAM usage went nuts and Apache freezes up requiring me to hard reboot. I dont get it. What could be the problem?