I recently got an email from someone saying that the development firms that they were working with were questioning EE’s abilities when it comes to handling high amounts of traffic. It’s been awhile since I have talked about ExpressionEngine's performance so I figured I would write a post about it specifically.
EE is definitely a scaleable solution. Over the last couple of years I have personally had conversations and know of EE sites that get many millions of pageviews per month.
One of the things that sets EE a part from the other CMSs is the fact that it is a multi-channel system. Typically, when I need to explain how this manifests itself on the site I describe it as such. When you go to the home page of your site and it has an image rotator, some new article headlines, some logos of some members or clients, contact information and more,there is a good chance that each of those is a channel (if the dev is doing things right). With EE you are making multiple queries to the Database per channel, and the system itself also hits the DB for info regarding the configuration. Oh, and there may be some add-ons installed that query the DB as well.
So as you can imagine all of that traffic back and forth is not healthy when a site is getting a metric poop-ton of traffic. You start throwing millions of pageviews at it and the site is going to slow down considerably.
How to Check How Many Queries your ExpressionEngine Site is using per Template
If you want to check how many queries your site uses per page then all you have to do is go into the control panel and select Admin->System Administration->Output and Debugging.
Then you want to change the Display Output Profiler to yes and Submit the settings.
Once you’ve done that you can go to the front end of your site, and assuming that you are logged in as a Super Admin you should see some of the following:
Benchmarks tells you the execution time for the page. That is the Total Execution time. Or at least what the system thinks is the load time. Other things can factor into this on the PC or Mac you are using. But this should at least give you some idea of how healthy the system is:
The section we are really wanting to take a look at is the Database section. It will show you the amount of queries for the template you are displaying and if you click on the (Show) it will open the accordion that holds all of the individual queries:
Once you’ve done that you should see things like the following:
So, I could detail what you can do to minimize the impact of having this much data being sucked out of a DB every time a user visits a page but that is a lengthy topic that I’ll have to cover in another write up. In general you want to use as few Channels as necessary. You don’t want to install any more add-ons than you absolutely have to have. And you want to make judicious use of the Disable parameter for the Channel Entries tag pair. If all of this is greek to you and you find yourself with a high traffic site suffering on EE then email us. We can help. For those of you still following, read on.
A simplified view of how Scaling ExpressionEngine Hosting Progresses as Traffic Increases
One thing many folks aren’t familiar with is the architecture of more robust hosting solutions when it comes to high traffic sites. Note, I did not say high traffic ExpressionEngine sites. A good hosting company can help quite a bit in making your life easier. Here's how scaling ExpressionEngine hosting typically progresses:
Shared Hosting - If you are using Shared Hosting then you are probably sharing that server with a lot of other sites.
Virtual Private Server (VPS) - You are still sharing a server but the resources are partitioned in such a way that you should be getting dedicated resources (CPU and RAM) but they are minimal.
Dedicated single server (EE and DB server on one) - You are not sharing the server with anyone so all of the available resources are yours. They can be configured however you might need them.
Dedicated dual servers (EE on one server and DB on the other) - With this solution you are splitting the DB onto it’s own server. This means that the DB does not have to share any of its resources with any of the other EE processes.
Multi-server set-up (many EE servers to one DB server) - This is where load balancing comes in. If you have multiple servers running EE they split the traffic equally. But they still have to hit the same DB.
Caching + dual/multi servers - EE on one or more servers and DB on its own server. This can all be fronted by Varnish or Memcached or some other caching mechanism. This severely lowers the demands made on the DB server because the site only queries the DB at set trigger points. Those triggers can be time or activity based (like updating an entry).
This progression is nothing new. Most of the top CMSs would progress in the same way. But I do want to be honest in that there is a propensity with EE to demand more of the Database server due to the fact that EE is a multi-channel system. So great care needs to be taken on high traffic sites to limit what you are pulling from the DB and to be smart about how you employ EE. This is where a knowledgable ExpressionEngine firm like ours can play a role. We can help you walk through some of the nuances of setting up ExpressionEngine the correct way.
I will also mention that many sites at a lower pageview limit will benefit greatly from caching. Add-ons like CE Cache are great. And I know a few people that use CloudFlare to front websites and are extremely pleased.
One last tidbit of free info. Do NOT use any type of grid hosting platform for ExpressionEngine. Most grid hosting platforms make EE almost unusable.
I hope this has been a helpful primer in understanding ExpressionEngine performance. Don’t let anyone tell you it can’t handle high amounts of traffic. And if you run into a bind and need someone to help troubleshoot an install we do offer consulting services for sites that need this special care.