Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Jun 07, 2009 5:38 pm 
Offline
Senior Newbie

Joined: Sun Jan 13, 2008 8:07 pm
Posts: 6
I write a blog that gets about 100 hits daily, but every so often I'll get picked up reddit or some other big site and my site promptly dies.

I'm running Ubuntu 8 LTS, apache2, mysql, and wordpress. What should I do to improve my site?


Top
   
 Post subject:
PostPosted: Sun Jun 07, 2009 5:45 pm 
Offline
Senior Newbie

Joined: Sun May 31, 2009 12:16 pm
Posts: 12
Interesting post here:
Wordpress Performance: Why My Site Is So Much Faster Than Yours (external)


Top
   
 Post subject:
PostPosted: Sun Jun 07, 2009 6:29 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Another option is to use the Coral cache. It's simple; all you do is add .nyud.net to the end of the hostname - for example, http://foo.example.com/bar/baz.php becomes http://foo.example.com.nyud.net/bar/baz.php .

Of course, using this without any work on your part means convincing people to use the Coralized URL when submitting your pages to Digg or whatever. As an alternative, see the section "Coralizing certain referrer sites" at http://wiki.coralcdn.org/wiki.php?n=Main.Servers -- you'll still get hits on your machine, but processing and sending clients a redirect should be easier on it than processing and sending the whole page.


Top
   
 Post subject:
PostPosted: Sun Jun 07, 2009 7:03 pm 
Offline
Senior Member

Joined: Tue Apr 29, 2008 6:26 pm
Posts: 58
Website: http://blog.shadypixel.com/
Here's what I would do:

1.) Install wp-super-cache: this caches full pages and it's ideal for situations where you're getting a ton of visits to only a small number of pages. When you serve a page, most of the time php code won't even be executed meaning you don't have to worry about php object caches or tweaking mysql.

2.) Serve all your static content (images, css, js) from a lightweight web server like nginx. This isn't really "faster" than apache, but it does use a whole lot less memory so you can serve way more visitors.

Implement those two changes and you should be able to handle reddit level traffic on even a linode 360.


Top
   
 Post subject:
PostPosted: Sun Jun 07, 2009 8:39 pm 
Offline
Senior Member

Joined: Sat Mar 28, 2009 4:23 pm
Posts: 415
Website: http://jedsmith.org/
Location: Out of his depth and job-hopping without a clue about network security fundamentals
Vance wrote:
Another option is to use the Coral cache.

A small advisory: Coral Cache is filtered by default by a lot of Web censorship gear. I know WebSense does for a fact.

(They had to work around kids typing myspace.com.nyud.net.)

_________________
Disclaimer: I am no longer employed by Linode; opinions are my own alone.


Top
   
 Post subject:
PostPosted: Wed Jul 08, 2009 6:05 pm 
Offline
Junior Member

Joined: Sat Mar 21, 2009 3:45 am
Posts: 48
Define more specifically what you mean by "my site promptly dies."

My very first suggestion is to install munin so you have trending on load and resource usage during good times and bad.

My next suggestion is to install the php-apc package. This saves PHP the problem of reparsing all the wordpress code files for each new request. In my testing, this easily cuts the per-page response time in half on an unloaded Wordpress site with a handful of plugins, and, as I recall roughly doubled throughput under load. The cost is some memory for the cached code, but for Wordpress, I think that is only 10-15MB, and it is shared across all the apache processes.

Once you have some data in munin you'll be better able to figure out where you should focus next. I'd guess though that under high load you end up with more apache processes than are really useful given the amount of memory you have on hand. Evidence of this would be less than full CPU utilization during traffic spikes, little or no "free" memory allocated to file cache or buffers, and a big jump in the use of swap space.

Next, I'd turn of HTTP keep-alives in apache, or reduce them a few 10s of miliseconds, otherwise, apache processes end up sitting around wasting memory waiting to see if a client is going to make another request.

Something like wp-super-cache can help, but I found that it resulted in odd behavior. The quirks would be acceptable during periods of high load, but I think you'd have to turn it on and off manually. I wouldn't mess with Coral cache, unless it was for a big file or something. Its a cool idea, but if you use it, you loose SEO benefits of being linked to, data about your users, etc.

As others have suggested, its worth using nginx or something similarly efficient to serve static content. I'd go even further and say its useful to have it reverse proxy dynamic content. Doing so means apache can move quickly on to serving the next dynamic request, rather than wasting memory for ~100-300ms waiting to return the output of the php script to the client. Nginx can also take care of the http keep-alives efficiently. I posted information about configuring nginx to front-end for apache+php+wordpress in this thread: http://www.linode.com/forums/viewtopic. ... 2010#22010


Top
   
 Post subject:
PostPosted: Wed Jul 08, 2009 6:18 pm 
Offline
Linode Staff
User avatar

Joined: Sat Jun 21, 2003 2:21 pm
Posts: 160
Location: Absecon, NJ
1) Check the MaxClients setting for Apache. The defaults on most distros are far too high for anything with less than a GB of memory.

2) If you're not using InnoDB tables turn in skip-innodb for MySQL. That saves about 5%-10% of memory on a Linode 360.

-James


Top
   
 Post subject:
PostPosted: Fri Jul 10, 2009 11:01 am 
Offline
Newbie
User avatar

Joined: Sun Jun 07, 2009 9:18 am
Posts: 2
Website: http://www.ivps.in
Location: Mlore, IN
Switch to NGinx + Apache Proxied + Wp-SuperCache

_________________
iVPS.in - Affordable Professional VPS setup & Maintenance.
Support @ iVPS . in


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


Who is online

Users browsing this forum: No registered users and 1 guest


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