Performance tuning
There are number of approaches which can help you to increase the system performance.
Use PHP accelerators with opcode caching
Opcode caching preserves compiled code from the PHP bytecode compiler. It results in higher application performance - instead of compiling the PHP source code on each request the server uses already compiled code. There are different accelerators available today. In our tests APC Cache demonstrated the best results. The major benefit of the APC Cache module is that it also provides the data caching functions.
Use data caching
LemonStand data caching API can work with different caching providers - APC, memcached and file-based caching. Caching pages and partials significantly reduces the server CPU load and accelerates the page generating. LemonStand caching system is descried in details in the following articles:
Enable the database structure caching
LemonStand database engine requires information about the database tables structure. To fetch the database structure LemonStand issues DESCRIBE SQL queries. You can enable the database structure caching if you have the data caching (see above) configured in your LemonStand installation. When the database structure caching is enabled, LemonStand stores the DB structure in the cache, which reduces the number of SQL queries.
It is not recommended to enable the DB structure caching on the development server, if you are developing custom modules and manage the DB structure manually. LemonStand updates the DB structure cache only during the software update process, or when the cache object expires. LemonStand uses the default TTL value specified in the caching configuration for caching the DB structure.
To enable the database structure caching add the following line to the config.php file:
$CONFIG['ALLOW_DB_DESCRIBE_CACHE'] = true;
Enable front-end queries optimization
The front-end queries optimization function removes all back-end specific parts from SQL queries, making them lighter and faster. The feature is disabled by default and can be enabled by adding the following line to the config.php file:
$CONFIG['OPTIMIZE_FRONTEND_QUERIES'] = true;
The front-end queries optimization is disabled by default because it is not always possible to separate front-end and back-end data. The feature is tested with all standard modules, but it could cause issues with third party modules which implement custom data manipulations. Test the store carefully after enabling the feature. If you face any issues, please submit a support ticket.
Enable proxy models
Proxy models are lightweight objects which can replace ActiveRecord models in some operations. At the moment this feature affects only the category tree on the front-end website. If you use hundreds of categories in your store, you can try enabling this option by adding USE_PROXY_MODELS parameter to the config.php script:
$CONFIG['USE_PROXY_MODELS'] = true;
Throughout our tests proxy models increased the category tree generating speed (3000 categories) by up to 100% and demonstrated reduced memory usage by up to 60%.
When the feature is enabled, list_root_children(), list_children(), get_parents() and get_parent() methods of Shop_Category class return proxy models instead of Shop_Category objects. In many ways proxy objects behave like Shop_Category objects, but consume less memory. You can access fields and call all methods of Shop_Category class through this object. If the proxy object cannot return a requested field or execute a requested method, it creates the normal Shop_Category object and passes the request to it. FIelds and methods which can be requested and executed without creating a model object are called "proxiable". Shop_Category class documentation has markers of proxiable and not proxiable fields and methods. You can achieve the best performance if you use only proxiable methods and fields in your category trees.
Previous: Moving LemonStand installation to another server
Return to Installation, Configuration and Maintenance

