Speed Testing is simply the title for this tutorial that walks you through some more reliable ways (other than counting "One-one-thousand, Two-one-thousand...") to test the speed of your site's pages.
Every site is built differently, so it would be impossible to cover every situation in this tutorial, but this guide should give you enough information to see how our performance products will perform (Or are performing) on your site and what other tools and methodologies you might use to further speed things up.
As always, there may be differing opinions on how best to run these tests and may even be better ways to go about it. If you’ve found something better drop us a line.
It's also important to note that this test should pretty accurately highlight one of the most common slow-downs in Magento--how long it actually takes the server to respond to a request. For many default installations, this is all the stands between taking a seriously slow anti-conversion site and speed it up to the pace where many think Magento should be in the first place. However, this toolset can be used on any site.
To do "Speed Testing" we'll be using a web utility known as Firebug that is an add-on to the popular web browser Firefox. This little utility will allow us to see the sub-sections of how a page loads. Everything from the initial request from your browser to how long it takes to download that pesky logo that you really didn't want, but a major investor loved. This level of detail let's us see what is taking the most time to load.
Now that Firefox and Firebug are installed, we need to change a few display options so you can really see what's happening when a page loads:
HTML view will help you see whether you need to enable caching of some sort (like Default Magento, Lightspeed, or other).
Since you're all setup, let's go ahead and test. Refresh the page that you're currently on, or browse to it if you're not already there. This should reload the performance tools and you should start seeing some things happen.
Whether you knew it or not, we've set up your Firebug net tab to display the overall performance of your page. This is measured in two ways; number of requests and the composition of each request.
Depending on how many major requests (or lines in Firebug) you have on the page, you may have one or many lines in your net tab. Typically, for a basic page, you only have one, but if you have external JS/AJAX/Image requests, there could be more lines. You might have a good reason for having more than 1-2, but in our experience, the fewer the better.
1-2 lines is pretty dang efficient:
5 or more probably means you could do more to combine requests and improve efficiency:
It's also worth noting that if you have any red lines with a "404 Not found" message in it, that you're wasting time on your page load. While you aren't loading anything with those requests (as you might expect with a message including the words "not found"), it does take that much more time to attempt to request that item.
Each request has several components. Depending on a variety of factors, one may become more important to make efficient your overall page load more efficient. It's all about which part of the request is taking the longest. You can see each of these components by mousing over each request line in the Firebug panel.
For this generalized test we're going to focus on "waiting", "server/page response" time. We could write a whole doc for each of the components and ways to help improve efficiency, but we'll leave that for another time. The waiting time is simply the time it takes the server to respond and start sending back data. In the case of Magento, this is how long it takes magento to run through all it's classes and interact with the database and start returning a page.
A typical Magento community edition installation (with the default caching turned on and using hardware that meet or exceed minimums), will still clock a waiting time anywhere between 1 and 4 seconds depending on which page you're loading. Typically, the sites closer to 1 second have substantial server hardware (more than 1GB memory on a dedicated server). While 1 second for an entire page to load may be quite good, response time on most fast sites is typically very low (measured in milliseconds not in seconds). That's because the response or wait time is only a small part of the whole process.
If you find your wait or waiting time is in seconds, like this one - 1.02+ seconds (very typical of default magento, even on a really nice server):
Rather than this one - 118 ms ~ 1/10 second (Lightspeed or other whole-page caching installed):
It probably means that there is room for improvement on how your server handles requests.
An integral part of any web page is the visual content from images, flash, and CSS design. Luckily, with Firebug, we don't have to only focus on the major request(s) of the page. We can zero in on specific parts of the page to see what parts are taking the most time.
Remember the top bar of the Firebug panel?
Well, you don't have to use the "HTML" button at the top. Try clicking on "All". That'll give you a view of every single object loaded on the page and how long it took to load it. Try the others, they have tendency to turn everyday users into page composition experts.
Now there really is no silver bullet to speed things up on a website. Especially a feature-rich e-commerce framework like Magento. However, there are several tools and tips that are especially helpful. They aren't comprehensive, but should help any developer find some good places to start. While they may require some work/research to leverage, they can put you ahead of the competition and many are free.
Page Speed - Page Speed is a tool developed by Google that analyzes pages and produces a report with suggestions on. It's results differ slightly from Yslow (but the same thing happens when you search at yahoo.com vs google.com)
Yslow - Yslow is a tool developed by Yahoo that analyzes pages and produces a letter grade based upon page HTML/CSS/JS structure, content sources, etc... It's a valuable tool that can help you determine where you stand compared to the competition in how efficient your pages render.
Lightspeed - Lightspeed is a for-paid Magento module that allows you to cache entire pages in an even more advanced fashion than Magento Enterprise Edition. Plus, it comes at a much more affordable price. ($13K/annually per server vs. $500 once per domain - unlimited servers)
Minify - Minify is a PHP5 app that helps you follow several of Yahoo!'s Rules for High Performance Web Sites (Compression of CSS/JS being an important one).
There are a plethora performance tips out there. I'd like to suggest a only a few. While it definitely doesn't cover everything, I've seen the following help the most (especially with regard to magento):
Front-end
Back-end (Magento only)