Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Nov 10, 2009 2:47 pm 
Offline
Senior Newbie

Joined: Thu Sep 03, 2009 4:23 pm
Posts: 5
Website: http://www.rivalsociety.com
Location: So Cal
I've been hosting a few very low traffic Wordpress blogs using a normal LAMP stack. The blogs are getting a bit more traffic and I've found myself running out of RAM. Because this is all for non-profit organizations I was hoping to find a way to make the most of the current node, without needing to upgrade to the next service level.

I'm pretty limited in my understanding in this area, but so far I've tried reverse proxying nginx to apache but couldn't get it to work, and tried just nginx+spawn-fcgi, but couldn't get that to work either.

My thought was to give Cherokee a try since Linode has a nice tutorial on it, but I don't want to waste another few days messing with it its not going to help.

So, I guess my question is: Would Cherokee help lower my memory footprint and be easy to maintain like Apache, or am I better off just sticking with Apache and stepping up to a bigger linode?

Any help or advice at all is much appreciated.


Top
   
 Post subject:
PostPosted: Tue Nov 10, 2009 4:02 pm 
Offline
Senior Member

Joined: Mon Jun 16, 2008 6:33 pm
Posts: 151
Quote:
I've been hosting a few very low traffic Wordpress blogs using a normal LAMP stack. The blogs are getting a bit more traffic and I've found myself running out of RAM.

A "normal" Lamp stack isn't appropriate for a VPS without some serious tightening of the config files, particularly your my.conf (see /usr/share/doc/mysql-server-5.0/examples) and apache.conf, at the very least. There are gazillions of posts on how to do this, both here and elsewhere. Eventualy, there may even be a section in the Linode Library on it...

Otherwise, you're just going to need to figure out Nginx/Lighttpd/etc. Seriously, it's not that hard, and there are many here who can help.


Top
   
 Post subject:
PostPosted: Tue Nov 10, 2009 4:17 pm 
Offline
Senior Newbie

Joined: Thu Sep 03, 2009 4:23 pm
Posts: 5
Website: http://www.rivalsociety.com
Location: So Cal
Thanks for the reply mjrich. I've actually read through both of the those articles and spent a fair bit of time playing with my.conf and apache.conf, and employed memecache and wp-supercache, all of which helped. It's been a good learning experience.

Is it safe to assume that because I've followed the articles you pointed out, and am still having memory issues, that my best course of action is to take another stab at nginx/lighttpd?

When I tried nginx I followed this http://www.mensk.com/webmaster-toolbox/perfect-ubuntu-hardy-nginx-mysql5-php5-wordpress/


Top
   
 Post subject:
PostPosted: Tue Nov 10, 2009 4:50 pm 
Offline
Senior Member

Joined: Mon Jun 16, 2008 6:33 pm
Posts: 151
While it's tempting to say yes! -- just dive into one of the other webservers, the reality is that you first really need to work out what is consuming all of your ram, when, and why. Out of curiosity, what does "a bit more traffic" translate to?

Installing munin (if you haven't already) should help nail it down, together with the standard cli tools, e.g. ps, top, htop, and scripts like http://www.pixelbeat.org/scripts/ps_mem.py.

Essentially, you need to know what is misbehaving (trying to serve too many requests, spending too much time waiting for a response, etc.), else run the risk of just fixing something that wasn't actually the problem.


Top
   
 Post subject:
PostPosted: Tue Nov 10, 2009 5:31 pm 
Offline
Senior Newbie

Joined: Thu Sep 03, 2009 4:23 pm
Posts: 5
Website: http://www.rivalsociety.com
Location: So Cal
There are 4 Wordpress blogs, which when I took over managing them were getting no more than 10-12 hits a day. At that point I had about 120 megs of free RAM. In that last few months the organizations that own the blogs have been growing, now they are getting 100-120 hits a day. In hindsight "a bit" was a horrible adjective to use.

I have not yet installed munin, I'll do that today. Been using top to asses memory usage and keep clients and servers in Apache under control.

Thanks for your help, it sounds like I jumped the gun and need to do more troubleshooting before asking questions. My apologies.


Top
   
 Post subject:
PostPosted: Tue Nov 10, 2009 6:06 pm 
Offline
Senior Member

Joined: Mon Jun 16, 2008 6:33 pm
Posts: 151
No worries.

You should be able to handle many, many more than 120 hits/day -- 100 requests/second is quite doable (albeit using httperf to test Drupal on Nginx/fastcgi). If you're running out of ram currently, then there is certainly some more tweaking that can be done.

Good luck, and post back when you've got a bit of data from munin etc. :)


Top
   
 Post subject:
PostPosted: Tue Nov 10, 2009 8:11 pm 
Offline
Senior Member

Joined: Thu May 21, 2009 3:19 am
Posts: 336
Just passing on advice I've picked up. Take a look at using WP Super Cache if you're not already:
http://wordpress.org/extend/plugins/wp-super-cache/

Have a look at this thread:
https://www.linode.com/forums/viewtopic ... ght=apache


Top
   
 Post subject:
PostPosted: Wed Nov 11, 2009 1:30 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Are you really running out of RAM with 120 hits per day? Care to post the output of free -m ? Apparently many people get confused by the way Linux reports memory usage, so it would be better to check that first. FYI, It's the second line (-/+ buffers/cache) that matters.

Next, check the MaxClients line in apache2.conf, as well as the key_buffer line in my.cnf -- these two lines are most often responsible for memory shortages on an out-of-the-box LAMP stack. As a safe default, Apache MaxClients should be below 50 (try 20), and MySQL key_buffer should be below half of your RAM.


Top
   
 Post subject:
PostPosted: Wed Nov 11, 2009 1:58 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
Hrrm, 120 hits per day is basically idle...

I'm thinking this is probably another situation for:

http://www.linuxatemyram.com/

But we'll see after we get back the "free -m" output.


Top
   
 Post subject:
PostPosted: Thu Nov 12, 2009 12:36 pm 
Offline
Senior Newbie

Joined: Thu Sep 03, 2009 4:23 pm
Posts: 5
Website: http://www.rivalsociety.com
Location: So Cal
free -m reports the following:

total used free shared buffers cached
Mem: 720 648 71 0 145 359
-/+ buffers/cache: 143 576
Swap: 127 0 127

For Apache I am using prefork with the following

StartServers 2
MinSpareServers 2
MaxSpareServers 5
MaxClients 100
MaxRequestsPerChild 2000

My mysql key_buffer is at 64M

So it sounds like for sure I need to lower my max clients. Am I also misunderstanding how linux reports RAM?

edit: I am running Ubunutu 8.04 LTS


Top
   
 Post subject:
PostPosted: Thu Nov 12, 2009 1:02 pm 
Offline
Senior Member

Joined: Mon Oct 27, 2008 10:24 am
Posts: 173
Website: http://www.worshiproot.com
Indeed you are. You have 576MB free. Check out the link Guspaz posted.


Top
   
 Post subject:
PostPosted: Thu Nov 12, 2009 2:28 pm 
Offline
Senior Newbie

Joined: Thu Sep 03, 2009 4:23 pm
Posts: 5
Website: http://www.rivalsociety.com
Location: So Cal
:oops: I am now returning to the catacombs of the UX world, never to bother you nice people again.

Thanks to everyone for your help, sorry I wasted your time with a server newbie mistake.


Top
   
 Post subject:
PostPosted: Thu Nov 12, 2009 8:02 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
rivalsociety wrote:
Thanks to everyone for your help, sorry I wasted your time with a server newbie mistake.

Don't feel too bad; I've seen experienced admins make the same mistake.

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group