FAQ Increase Performance: Difference between revisions
| Line 11: | Line 11: | ||
Enabling/Disabling such a module depends on your PHP system and OS. The most common way is to comment a line into you php.ini and restart web server. | Enabling/Disabling such a module depends on your PHP system and OS. The most common way is to comment a line into you php.ini and restart web server. | ||
== Applicative cache | == Applicative cache using MemCached == | ||
Efficiency: ***** | Efficiency: ***** | ||
Revision as of 13:28, 10 April 2011
Dolibarr is a web application designed to have best response time. A lot of technologies are used but some of them are not enabled by default as they need some specific skills to use them. This is a list of all possible things you can do to increase Dolibarr speed.
Recommanded solutions
Disable xdebug
Efficiency: *****
Principle: If php module xdebug is active, you should disable it. This module is a PHP feature to help developpers but it's useless for a production usage and slow down all PHP softwares. To know if this module is active, go on page Home-Setup-System info-PHP and do a search on xdebug. If you don't find anything, module is not active. If you find an occurence, module is active and can be disabled.. Enabling/Disabling such a module depends on your PHP system and OS. The most common way is to comment a line into you php.ini and restart web server.
Applicative cache using MemCached
Efficiency: *****
Principle: Go on page Module MemCached EN.
PHP OPCODE cache
Efficiency: ****
Principe: Install an apache/php module that save PHP pages compilation result into a cache. Each page access will be then faster. For this, you can install any PHP accelarator. xcache is one of the recommanded solution. Note that caching occurs here on a different lelel than Module MemCached, so gains are cumulative !
HTTP cache of static pages
Efficiency: ***
Principle: You can setup apache to activate explicit cache of static resources by adding following directives:
# Cache for static resources (Enable expiration and set it to A2592000 = 1 month)
ExpiresActive On
ExpiresByType image/x-icon A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType application/javascript A2592000
Again, gain is cumulative with other previous caches.
Use mysqli driver instead of mysql
Efficiency: ***
Principle: If you use a mysql database, check into your Dolibarr config file htdocs/conf/conf.php that you have the line
$dolibarr_main_db_type='mysqli';
If value is mysql, change it into mysqli that provide better performances (gain is 30ms for each page call).
Search on beginning of field
Effciency: ***
Principle: Si vous avez activé dans le module Produit la recherche par "autocomplete" et si la liste met du temps à apparaitre à chaque saisie de caractère, c'est que vous avez un nombre important de produit. La recherche se faisant n'importe ou dans le texte, l'index de base de donnée ne peut être utilisé. En ajoutant la constante PRODUCT_DONOTSEARCH_ANYWHERE à 1 dans Accueil-Configuration-Divers, vous limiter la recherche au début de la chaine rendant possible l'utilisation de l'index et obtenez une réponse immédiate.
Other solutions
Efficiency: ****
Pre-requisites: Using an Apache web server
Principle: Add into Home-Setup-Other the constant MAIN_OPTIMIZE_SPEED. If value of constant has bit 1 set, Dolibarr will use shared memory to cache translation of language files. This means that only one language can be used (the one defined by first user that log after the Apache server reboot). Use Module MemCached EN that has no limitations instead of this option and is more efficient.
Use precompressed version of Javascript libraries
Efficiency: *
Pre-requisites: Need to edit Apache setup.
Principle: Add into Home-Setup-Other the constant MAIN_OPTIMIZE_SPEED. If value of constant has bit 0 set, Dolibarr will use the minifying and compressed version of javascript. Apache server must be configured to have the line
AddType text/javascript .jgz
AddEncoding gzip .jgz
Then clean your cache browser. This feature seems to fails on HTTPS (security error for an unknown reason).
Compressing on the fly libraries and css
Efficiency: *
Principle: Add into Home-Setup-Other the constant MAIN_OPTIMIZE_SPEED. If value of constant has bit 2 defined (Example: MAIN_OPTIMIZE_SPEED=4), Dolibarr will return pages compressed into GZ (and if browser support it). This consume more CPU on server but reduce transfer time. Use it with slow connexion.
Note: To enable all optimization using MAIN_OPTIMIZE_SPEED, you must enable all bits (Example: MAIN_OPTIMIZE_SPEED=7 so 1+2+4 contains bit 0, 1 and 2).