I have been doing magento performance tuning for quite a while now. Me and the rest of goivvy.com team helped www.sportula.com and www.surveillance-video.com and other eCommerce websites get better page loading times. So I know a few things.
While some speed optimization tweaks require extensive knowledge of magento platform and server setup others require no programming at all yet they are effective.
This post brings together the field proven performance tuning techniques Goivvy.com uses to help clients with their slow magento website problems. You are free to skip steps that require extensive programming - just do your best with easy ones and you should be able to speed up your eCommerce store on your own.
This guide mainly target Magento 1.x. See how you can speed up Magento 2.
Why is Magento Slow?
It mostly happens due to wrong configuration and wrong choice of hosting provider. See Magento is not Shopify, you are not restricted on SKU numbers or anything like that but with great power comes great responsibilities. You do need the right hosting and if you are not tech savvy you do need a trustworthy magento programmer to help you along the way.
Another common problem - too many product attributes with too many choices created and used. Adding color product attribtues with just a few choices (black,white,green) would not hurt. Creating 10 product attributes with hundreds of choices would sure slow down magento website. Take a look here https://www.surveillance-video.com/dome-cameras/ . You can see Resolution product attribute with many choices as well as other multiple choices attributes. Without proper optimisation it slows down magento website.
Magento Performance Tuning in 7 Steps
Here is how to make magento website fast. Keep these steps in mind when you build your eCommerce store as well as when you run it.
1. Magento Optimised Hosting
Start magento performance tuning with shopping for host provider. Get a decent hosting. Do a research, do not go cheap here. Hosting is the foundation of your eCommerce store. Lay a good foundation. Some hosting providers offer magento optimised solutions - check out Nexcess for example. (no they are not paying us:)
Shared or dedicated - it is really up to you to decide. In my experience i have seen many stores running pretty fast on shared servers.
Look for datacenter that is closest to your customers. You want to eliminate network issues.
I would consider choosing the right host as the most important magento performance tuning advice. Build your eCommerce business on solid ground.
2. Reduce time to the first byte (TTFB)
TTFB is the measure of how quick your website responds to browser requests. In simple words it is the main speed parameter that tells you how fast your magento store is.
I wrote a tutorial on how to reduce TTFB step by step. There is a magento built in tool - Profiler - that lets us inspect what the platform does behind the scenes and tweak magento performance.
Good TTFB should be under 1s. You can use online tools like Pingdom to see what is your TTFB. If it is way over 1s - that is a sign that you should start reducing it.
3. Optimise MySQL database
Magento performance tuning cannot be done without optimising database.
First gather MySQL internal statistics with mysqltuner script. This awesome program tells you what is wrong with your database server and what needs fixing. It requires perl interpreter to be installed on the server.
Look for MySQL Table Cache Hit Rate (table_cache). If it says 0% - you are not using database table cache at all. MySQL Table Cache configuration lets DB keep tables in memory thus speeding up access to its data. Tweak table_cache parameter in my.cnf file to have table cache hit rate as close to 100% as possible.
Another setting to check is Table Open Cache (table_open_cache). That parameter greatly affects performance by making the same table available for different sessions.
I would advice you to get an expert in MySQL optimisation to check your database server. If you are on shared hosting you probably don't need to worry about database tuning - host team does it for you. If you run dedicated server either spend time learning MySQL configuration or get your DB configured by experts.
4. Enable Cache
4.1 Internal Magento Cache
This one is pretty easy. Magento has internal cache system that might have been turned off by your developer.
First make sure you enable cache at System > Cache Management.
4.2 APC or Memcached
Second - tell your programmer guy to enable magento configuration cache in app/etc/local.xml file. Go with APC or Memcached but check first if your hosting supports it.
APC and memcached are tools that let magento cache session and other important data.
5. Full Page Cache Extension
Spend a few bucks on it. It really works and it does speed up your magento store big time. Installation and setting up are mostly handled by the same vendor you buy FPC extension from.
Full Page Cache plugin stores the whole pages in cache. It reduces TTFB making your eCommerce store literally lightning fast. FPC is a must for magento performance tuning.
Magento Enterprise comes with full page cache already built in but do you need Magento Enterprise?
Varnish is a little program that caches parts of your webpage. Magento 2.0 supports Varnish out of the box. If you run Magento 1.x you would need a free extension by Nexcess - Turpentine. It is freely available on Magento Connect. Turpentine is used by many stores and it follows Varnish Cache Best Practices.
You should also make sure your host supports Varnish. If you are among others who run dedicated server you might need to install and configure Varnish daemon.
Test your varnish implementation before going live! Check if your cart block at the top updates and if it contains the products you added. Varnish might break your eCommerce store so give it a good test drive.
7. Content Delivery Network (CDN)
Sign up for CDN. It is cheap. It does serve your static content (images, css/js files, video etc) faster than your host does. Companies to look for are MaxCDN, Cloudflare. Ask your host - maybe they offer CDN services as well.
Why Should I Care
Speed is important. Not only it affects your Google Rankings but it also makes checkout less irritating. Nobody wants to wait especially when buying on the internet.
The magento performance tuning tips above will make your online store fast and more attractive to the potential customers.
If you find this post interesting do not hesitate to sign up for our newsletter and join the 636 people who receive Magento news, tips and tricks regularly.