Handling Extreme Traffic
If your site is very active, we strongly suggest implementing some of the following measures to reduce load times and sql queries.
Table of Contents
- Follow EE's extreme traffic methods
- Disable SQL Query Caching
- Turn off garbage collection
- Shorten session expiration time
Follow EE's extreme traffic methods
Start by following ExpressionEngine's own extreme traffic methods
Disable SQL Query Caching
Do not enable sql query caching, or if enabled, turn it off. Query caching will cause your data to go stale, and may cause users to get unexpected results, causing page reloads. To turn this off, go to EE's settings » admin » system administration » database settings » Enable SQL Query Caching » set to "no"
Turn off garbage collection
The most critical item is probably turning off CartThrob's automatic "garbage collection". When this is set to run manually in a "cron job" we've seen sites capable of handling hundreds of thousands of transactions per hour running on standard shared hosts not specially tuned.
Go To CartThrob settings » global » Do session garbage collection in a cron job? set to "Yes". This makes CartThrob's cart management run manually, instead of each time a customer visits a page. If you have hundreds or thousands of active carts, your system may slow to a crawl when CartThrob tries to find expired carts and remove them. Use a "cron job" to manually run this garbage collection instead of the default method.
Contact your server administrator for more information on setting up a cron job. Sample cron code is included in CartThrob's settings to help you setup cron.
Shorten session expiration time
Shorten the session expiration time, also in CartThrob's global settings. The longer the session, the longer abandoned carts stay active, and the more data you have floating around in your database.