This is the documentation for LemonStand V1, which has been discontinued. You can learn more and upgrade your store here.

LemonStand Version 1 Has Been Discontinued

This documentation is for LemonStand Version 1. LemonStand is now offered as a cloud-based eCommerce platform.
You can try the new LemonStand and learn about upgrading here.

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 the shipping option caching

The CACHE_SHIPPING_METHODS parameter has been introduced in the Shop module version #1.25.78. The parameter enables the shipping options caching in cases when the cart contents and shipping address have not been changed. It increases the store performance by removing unnecessary HTTP requests to shipping providers from the checkout processing.

The default parameter value is TRUE in LemonStand copies installed after April 04 2013. The value is FALSE in installations created before this date. Add the following line to the config.php file to enable the caching:

$CONFIG['CACHE_SHIPPING_METHODS'] = 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.

Enable STRAIGHT_JOIN support

Performance of some queries can be significantly improved with STRAIGHT_JOIN MySQL feature. LemonStand uses it for the category product listings. For compatibility reasons, this option is disabled by default. If your category pages load slowly you can try to enable this feature by adding ALLOW_STRAIGHT_JOIN parameter to the config.php script:

$CONFIG['ALLOW_STRAIGHT_JOIN'] = true;

Disable category top products feature

If you don't use top category products feature it makes sense to disable it, because it can slow down the category product listing. Shop_Cagegory::list_products() method assumes that the feature is enabled by default. To disable it pass FALSE to the 'apply_top_products' parameter in your list_products() calls:

$product_list = $category->list_products(array(
  ... other parameters ... 
  'apply_top_products'=>false
))    


Previous: Moving LemonStand installation to another server
Return to Installation, Configuration and Maintenance