WordPress Optimization: Use Your Server More Efficiently, Part One
Getting Started with WordPress Optimization
For most people, WordPress works fine right out of the box. However, when your blog becomes popular, you'll find it can be a hog, generating timeouts, consuming massive CPU cycles and server resources. Eventually, your web host will complain, probably threatening to shut you down if something doesn't change. Usually, they will suggest that you could buy more server space, a bigger server, or go to a dedicated host. But before you spend the big dollars, consider optimizing WordPress so it runs lean - and inexpensively.
I was faced with a WordPress site that was getting an average of 100,000 hits per day. Our web host sent us a nasty-gram when they realized we were using 40% of the CPU - they wanted us to use 3%. Since we are on a shared host, we were using resources needed by other websites. Essentially, we were really obnoxious party guests, hogging all the shrimp and drunkenly crashing around the dance floor. Something had to be done, or we were going to be ejected from the party.
There are several easy things to change that will produce immediate results. In addition, there are other things that are a bit more complex, but can trim off that last little bit to keep the web hosting company off your back, and turn you back into a polite guest at the party. Employing these tactics, I was able to reduce our resource consumption to 1/10th - well within the limits required by our web hosting company.
This is part one of a three-part collection on WordPress optimization. Getting Started with WordPress Optimization describes how to prepare yourself for success. Easy WordPress Optimization provides a selection of easy things to do that will produce a faster, leaner WordPress installation. Advanced WordPress Optimization describes further tactics that useful, but require stepping outside the confines of WordPress to edit the configuration of your website.
Getting Started:
The first thing you'll want to do is understand the problem, and to do that, you'll need statistics. Blindly flipping switches without any idea of the impact isn't going to give you the information you need to make intelligent decisions. Worse - if you don't know what you did to fix the problem, it's likely you'll mess it up again in the future. Or someone else will, and you won't know why things suddenly went back to being problematic.
Think of the problem as three questions: Who is using your website (Web Statistics), How bloated is your copy of WordPress (Resource Statistics), and how efficiently are you working with your blog readers (Browser Statistics)?
Web Statistics:
Any good host will provide you with a web statistics tool such as AWStats, W3Counter or Webalizer. This will tell you things like what are your most popular pages or files, how many hits you are getting, where your visitors are coming from, what they are looking for, and who is consuming your precious resources. You may also find some surprising details, such as if you have been hosting content for some other malicious site, or if another site is hot linking to your content (using your bandwidth for free).
In our case, We were surprised to find that a full 20% of our traffic was being generated by web spiders such as Google, Yahoo and Bing. Impressions are good - but in this case, there was no way these were going to convert to click-throughs. Our content updated about every three hours, yet we were being indexed every ten seconds. Obviously, these arachnids need to be tamed.
Resource Statistics:
You may need to ask your web host where to find these, as most websites aren't concerned about this level of detail. In your case, you do care, and you'll need to know how much of an obnoxious party guest you are, and in what ways. You'll want to know your consumption rates for bandwidth, CPU, mySQL (database) and disk space. Be sure you know what is limited, and how much you are using. This will help you focus on the big problems, rather than playing with tweaks that will only produce marginal solutions.
If your web host has contacted you, it is likely that they also informed you where the problem is. Learn everything about that problem - if you don't understand the lingo, you won't understand the solution.
In our case, our web host provides us with unlimited disk space, but worries about CPU utilization. This was useful to know when setting up caching (more below). They also limit our bandwidth (the amount of information we send out over a period of time) but for us, that limit was well above what we were using, so it wasn't a concern.
Browser Statistics:
Think of your website as a partnership with your readers. You could have a sloppy relationship, sending them a lot of unnecessary information, much of which they will discard like junk mail. Or you could have an efficient relationship, sending them only the information they need, and letting them know how long they should keep that information around.
This is called browser optimization, and will not only reduce the load on your server, but will also delight your readers with your zippy performance. There is no buzz-kill like a web site that loads with the speed of cold molasses.
You'll need a tool to help you with this, and there are several. These tools will read the contents of your website, analyze the parts you are sending out, then suggest ways to improve your performance. There are several online tools available - look at websiteoptimization.com for one. For more serious analysis, consider downloading Firebug for Firefox, IE Webdeveloper for Internet Explorer, or using "inspect element" with Safari or Chrome. You are looking for audits or timelines - these will tell you what was sent across the internet, how long it took to get to the desktop, and if the transmission was efficient.
Don't get frustrated - this is a bit complex, and the first time you see a performance audit you may be overwhelmed with the strange terminology and wealth of numbers. Stick with it, do some research and focus on the big numbers first - that's your best bang for the buck.
We immediately discovered two things using these tools: First, we were sending huge images that were resized by the browser. One image was 600 pixels wide by 400 pixels high, but was resized to 150 pixels by 100 pixels. We resized the copy we had stored on the server, and this image became 75% more efficient. We also discovered that when a reader went to a second page, the same image was again downloaded - by increasing the image expiration time, the browser cached the image and used a copy from the desktop, instead of using our bandwidth for a fresh, unnecessary copy. It doesn't take fixing a lot of these bloated images to create some real savings.
Communicate with your web host:
Finally, be sure to let your web host know that you are working on the problem, and what you intend to do. They will be much more tolerant of your website's bad behavior if they know you are actively working on fixing the problem. Better yet, they will probably have helpful suggestions on things you should focus on, and can explain things that are confusing. They are your friends, they want to keep you as a customer, and they deal with this type of thing all the time. If they aren't willing to help, it may be time to find a new web host.
This is the end of the first part of this three-part series. Next is "Easy WordPress Optimization" where I'll describe some easy ways to improve your WordPress site performance.
I was faced with a WordPress site that was getting an average of 100,000 hits per day. Our web host sent us a nasty-gram when they realized we were using 40% of the CPU - they wanted us to use 3%. Since we are on a shared host, we were using resources needed by other websites. Essentially, we were really obnoxious party guests, hogging all the shrimp and drunkenly crashing around the dance floor. Something had to be done, or we were going to be ejected from the party.
There are several easy things to change that will produce immediate results. In addition, there are other things that are a bit more complex, but can trim off that last little bit to keep the web hosting company off your back, and turn you back into a polite guest at the party. Employing these tactics, I was able to reduce our resource consumption to 1/10th - well within the limits required by our web hosting company.
This is part one of a three-part collection on WordPress optimization. Getting Started with WordPress Optimization describes how to prepare yourself for success. Easy WordPress Optimization provides a selection of easy things to do that will produce a faster, leaner WordPress installation. Advanced WordPress Optimization describes further tactics that useful, but require stepping outside the confines of WordPress to edit the configuration of your website.
Getting Started:
The first thing you'll want to do is understand the problem, and to do that, you'll need statistics. Blindly flipping switches without any idea of the impact isn't going to give you the information you need to make intelligent decisions. Worse - if you don't know what you did to fix the problem, it's likely you'll mess it up again in the future. Or someone else will, and you won't know why things suddenly went back to being problematic.
Think of the problem as three questions: Who is using your website (Web Statistics), How bloated is your copy of WordPress (Resource Statistics), and how efficiently are you working with your blog readers (Browser Statistics)?
Web Statistics:
Any good host will provide you with a web statistics tool such as AWStats, W3Counter or Webalizer. This will tell you things like what are your most popular pages or files, how many hits you are getting, where your visitors are coming from, what they are looking for, and who is consuming your precious resources. You may also find some surprising details, such as if you have been hosting content for some other malicious site, or if another site is hot linking to your content (using your bandwidth for free).
In our case, We were surprised to find that a full 20% of our traffic was being generated by web spiders such as Google, Yahoo and Bing. Impressions are good - but in this case, there was no way these were going to convert to click-throughs. Our content updated about every three hours, yet we were being indexed every ten seconds. Obviously, these arachnids need to be tamed.
Resource Statistics:
You may need to ask your web host where to find these, as most websites aren't concerned about this level of detail. In your case, you do care, and you'll need to know how much of an obnoxious party guest you are, and in what ways. You'll want to know your consumption rates for bandwidth, CPU, mySQL (database) and disk space. Be sure you know what is limited, and how much you are using. This will help you focus on the big problems, rather than playing with tweaks that will only produce marginal solutions.
If your web host has contacted you, it is likely that they also informed you where the problem is. Learn everything about that problem - if you don't understand the lingo, you won't understand the solution.
In our case, our web host provides us with unlimited disk space, but worries about CPU utilization. This was useful to know when setting up caching (more below). They also limit our bandwidth (the amount of information we send out over a period of time) but for us, that limit was well above what we were using, so it wasn't a concern.
Browser Statistics:
Think of your website as a partnership with your readers. You could have a sloppy relationship, sending them a lot of unnecessary information, much of which they will discard like junk mail. Or you could have an efficient relationship, sending them only the information they need, and letting them know how long they should keep that information around.
This is called browser optimization, and will not only reduce the load on your server, but will also delight your readers with your zippy performance. There is no buzz-kill like a web site that loads with the speed of cold molasses.
You'll need a tool to help you with this, and there are several. These tools will read the contents of your website, analyze the parts you are sending out, then suggest ways to improve your performance. There are several online tools available - look at websiteoptimization.com for one. For more serious analysis, consider downloading Firebug for Firefox, IE Webdeveloper for Internet Explorer, or using "inspect element" with Safari or Chrome. You are looking for audits or timelines - these will tell you what was sent across the internet, how long it took to get to the desktop, and if the transmission was efficient.
Don't get frustrated - this is a bit complex, and the first time you see a performance audit you may be overwhelmed with the strange terminology and wealth of numbers. Stick with it, do some research and focus on the big numbers first - that's your best bang for the buck.
We immediately discovered two things using these tools: First, we were sending huge images that were resized by the browser. One image was 600 pixels wide by 400 pixels high, but was resized to 150 pixels by 100 pixels. We resized the copy we had stored on the server, and this image became 75% more efficient. We also discovered that when a reader went to a second page, the same image was again downloaded - by increasing the image expiration time, the browser cached the image and used a copy from the desktop, instead of using our bandwidth for a fresh, unnecessary copy. It doesn't take fixing a lot of these bloated images to create some real savings.
Communicate with your web host:
Finally, be sure to let your web host know that you are working on the problem, and what you intend to do. They will be much more tolerant of your website's bad behavior if they know you are actively working on fixing the problem. Better yet, they will probably have helpful suggestions on things you should focus on, and can explain things that are confusing. They are your friends, they want to keep you as a customer, and they deal with this type of thing all the time. If they aren't willing to help, it may be time to find a new web host.
This is the end of the first part of this three-part series. Next is "Easy WordPress Optimization" where I'll describe some easy ways to improve your WordPress site performance.
Published by Mark Niemann-Ross
Mark Niemann-Ross has been explaining technology for thirty years. First as an Industrial Education teacher, then as a software developer evangelist, and most recently as a published Science Fiction Writer.... View profile
- Upgrading WordPress Blogs It is important to upgrade your Wordpress script with the latest versions, for security and optimum performance.
- Starting a WordPress Blog Tutorial on how to start a basic Wordpress Blog and how to promote content such as Associated Content articles through a Wordpress Blog.
- Using Keyword Named Folders for Image Optimization SEO There are many more tricks than most think in Image Optimization SEO. In this guide I show you how naming your image folders greatly Improves Image SEO.
- Non-Techies Intro to Site Search Engine Optimization (SEO) A plain English explanation of how to get started improving your site's Search Engine Optimization.
- 6 Signs of a Good Web Hosting Company The web hosting company you select can build or smash your small business.
- WordPress Optimization: Use Your Server More Efficiently, Part Two
- Web Hosting Services and How to Choose Your Web Hosting Company
- Choose the Right Web Hosting for Your Needs
- Generating Website Statistics with Piwik Web Analytics
- Understanding Web Server Log FIles
- Measuring Human Resource Efficiency and Effectiveness
- Easy Ways to Optimize Wordpress for Search Engines
|
|
More from Yahoo! News