I need a way to cut resources and optimize my site for speed. The digg effect shuts my site down when 10,000 people show up. So I need a way to deal with spurts. I use hyper cache but it seems to slow things down.
Any super heavy plug ins I should avoid?
Im going to start by getting rid of rarely used plug ins.
I also noticed on wp that hyper cache freezes ads. This is another problem, I have to get rid of some of them too.
My first suggestion is to upgrade to 2.7. There isn’t necessarily any specific performance enhancements in 2.7, but some optimization is always happening in every revision of WordPress. Besides, it’s just the smart thing to do, security-wise!
WP Super Cache is a great plugin, it helps me reduce load on some of my more busy sites. If you are Dugg, you might weather the spike better with Super Cache’s “Lock Down” feature. But it could take some tweaking to gain maximum benefit, I would see what the plugin developer all has to say about it.
Of course, the developer also says:
Don’t expect a cheap hosting plan to survive a major traffic spike, even if it is cached!
Are you using a cheap host?
You might need to attack this problem from both ends, increasing your server resources, and reducing the resources that your site uses.
Less ads will speed up your pageloading(and sometimes less is more), but if they are being served from an ad network, they aren’t causing much load to your server. If you are using more than one network, maybe one is not keeping up?
I’d suggest paying attention to your queries to the database as well. Each time you load a post or a comment in your sidebar, or any other content from your database, you are adding load to your database.
There is a code in the default theme’s footer which puts the number of queries to load a page as a comment in that page’s code. I’d suggest you use that to keep tabs on your queries, and reduce the amount of content on each page to ease the load on the database:
<!-- <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. -->
As an aside, I like your header graphic, but the typography needs some adjusting, all caps as body copy is very hard to read…
I found WP Tuner to be very helpful in understanding what was hurting responsiveness of my blog. Once you install and activate it, it hooks the hookable operations in wordpress and tracks execution time, query count, query time and memory usage at each step.
One thing that is immediately obvious is that startup is an expensive process. It happens on every page load, and accounted for 30-50% of the execution time in most cases. If you need finer-grained profiling than WP Tuner can achieve via the available hooks, you can go in and add one-line timing statements wherever you want. Doing so showed me that plugin loading was the most costly part of the startup process. Some plugins were worse than others, but even the quickest loading plugins still added up.
The only way I found to really improve startup times was to set up a test machine and install APC which caches already parsed PHP code to speed up execution. Unfortunately, I couldn’t take advantage of this on my shared hosting. I expect the same is true with most other shared hosts, because I think it increases baseline memory requirements, and may create security issues. There are some shared hosts, like Webfaction, that give you your own Apache instance and let you do pretty much whatever you want with it. APC should be an option for any dedicated host or VPS.
The next thing you can do is optimize database use. The quickest path is to use something like WP-super-cache that can cache the HTML from generated pages, but you’ve already found the disadvantage of this approach, dynamic elements of the site get frozen until the cached copy is expired.
Fortunately WordPress has an object caching framework that can cache at a finer level, so you can still take advantage of dynamic page generation, while caching the results of database queries and the like. One option is to use a simple file based caching backend. I’ve been using this, which seems to help. It looks like this does something similar. Some people have reported that their shared hosts have complained about the disk IO this approach causes, but I’ve had no trouble.
There are other back-ends as well. One for APC, another for MemcacheD, and perhaps others. As with APC itself, these probably aren’t an option on most shared hosts.
These things should help with responsiveness when your traffic is low as well as high, and they should help your ability to ride out traffic surges.
There is a lot more in the WordPress documentation, but I’d suggest starting out with WP tuner so you can get a handle on where time is being spent on the server-side.
Thanks for this really useful reading, explanations and links.
you can also try this mod of wp super cache: http://murmatrons.armadillo.homeip.net/features/experimental-eaccelerator-wp-super-cache and this object cache plugin instead of the neosmart one (very old) http://murmatrons.armadillo.homeip.net/features/eaccelerator-wordpress-object-cache
I just went through 2 month of optimizing mysql, apache, wordpress, eliminating plugins, checking themes so I know what you are looking at 🙂
- The topic ‘Optimize Speed’ is closed to new replies.