Pagoda Box has several optimization tools available to help you get the most out of your Magento application. After reading this guide, you should be familiar with:
- Installing a bytecode caching extension
- Configuring Magento to use Memcached
- Other Miscellaneous Optimizations
Note
This guide is intended to be used in conjunction with the Magento Configuration Guide. So if you don't have Magento up and running yet, start there first.
Bytecode Caching
Bytecode caching stores the code generated by PHP so it doesn't have to parse and compile scripts on every request. APC & eAccelerator are two bytecode caching extensions available on Pagoda Box. We recommend using eAccelerator. Simply add it to your list of php_extensions in your Boxfile and deploy. No additional configuration is required.
YAMLAdd eaccelerator Extension
Memcached
Memcached is a distributed memory caching system that caches data and objects in RAM. That means instead of storing items like cache and sessions in writable storage or in the database, you can store them in RAM which is much faster.
Add Memcached Component
First you'll need to add a Cache component to your application. Components can be added via your Boxfile or the dashboard. Here's how to add it via the Boxfile. Keep in mind that the component won't actually be created until you deploy your change.
YAMLAdd Memcached Component
Add memcache Extension
Next, add the memcache extension to your list of php_extensions in your Boxfile.
YAMLAdd memcache Extension
Configure Magento to use Memcached
In your Pagoda Dashboard, click on the "Show Credentials" link of the cache component and take note of the credentials.
In your app/etc/local.xml file, make the following changes using your cache component's credentials. This is an implementation of the example code located in Magento's app/etc/local.xml.additional file. Note that the settings for sessions and memcache are independent of each other. So you could optionally save only sessions or only cache in memcache. Or you could create multiple cache components and store sessions in one and cache in the other. It's up to you.
XMLMagento Memcache Configuration
Note
Keep in mind that you'll most likely need to clear your Magento cache for this configuration change to take effect. Also, note that any current sessions will be destroyed since Magento will now be looking for sessions in a new location.
Magento Settings
Avoid using Shared Writable Storage
Magento has a few optimization utilities that merge application files and place them in shared writable storage. In a traditional server environment, this is good because it simplifies the web requests required for each page load. But, on Pagoda Box the benefit is negated by the fact that your application accesses files in its repo faster than reaching out to files in shared writable storage. So the general rule of thumb is to keep as much code in the repo as possible vs writable storage. Although, if you have a method of combining/compressing files locally and pushing those files up with your repo, then you may still benefit from file compression.
Ensure you have JS & CSS disabled by going to System->Configuration->Advanced->Developer-> and set "Merge" to "No" on both JavaScript Settings & CSS Settings.
Ensure the Magento Compiler is disabled by going to System->Tools->Compiliation and check that the "Compiler Status" is "Disabled".
Disable Logging
Magento has a few logging utilities that can provide helpful information, but also dramatically increase the number of database reads and writes.
If you don't need the System & Exception logs, disable them by going to System->Configuration->Developer->Log Settings and change "Enabled" to "No".
If you don't need the user browsing activity logs, disable some or all of them by adding the following code to your app/etc/local.xml file.
XMLDisable User Activity Logging
Enable All Default Caching Options
This should go without saying, but ensure you've enabled all the default caching options available at System->Cache Management.
Disable Unused Modules
Disable any unused Modules at System->Configuration->Advanced->Advanced.
Expires Browser Caching
You can increase the number of files browsers cache by adding the following code to the .htaccess file in the root of your application.
ApacheExpires Browser Caching
Scale Server Resources
After you've optimized your application and environment as much as possible, it's time to scale your server resources. Since Magento is extremely database intensive, DB RAM will most likely be the first place you'll want to start. Large catalog/high traffic stores will most likely require a dedicated database.
Bytecode Caching
Memcached
- Add Memcached Component
- Add Memcached Component
- Add memcache Extension
- Add memcache Extension
- Configure Magento to use Memcache
- Magento Memcached Configuration
Magento Settings
- Avoid using Shared Writable Storage
- Disable Logging
- Disable User Activity Logging
- Enable All Default Caching Options
- Disable Unused Modules