Table of Contents

  1. Introduction

  2. Understanding Performance Bottlenecks in Dolibarr

  3. Step 1: Optimize Server Infrastructure

  4. Step 2: Clean and Configure the Dolibarr Database

  5. Step 3: Fine-Tune PHP, Apache, and MySQL Settings

  6. Step 4: Improve Dolibarr Configuration and Module Usage

  7. Step 5: Monitor, Maintain, and Automate Performance Checks

  8. Final Thoughts


1. Introduction

Dolibarr ERP & CRM is one of the most popular open-source business management solutions in the world, especially among SMEs. Its modularity, ease of use, and cost-efficiency make it an excellent choice for businesses across various industries.

However, like any web-based software, Dolibarr can become slow or unresponsive over time if it is not properly optimized. Users often report issues such as:

  • Slow page loads

  • Lag during invoice generation

  • Timeouts while updating records

  • Delays in accessing documents or modules

In this article, we’ll walk you through a comprehensive 5-step strategy to drastically improve the performance of your Dolibarr instance. Whether you’re self-hosted or running on a shared VPS, this guide will help you identify and resolve common bottlenecks to ensure your ERP runs smoothly.


2. Understanding Performance Bottlenecks in Dolibarr

Before jumping into solutions, it’s important to understand where performance issues typically originate. In most Dolibarr setups, slowness can be caused by one or more of the following:

  • Underpowered or poorly configured hosting infrastructure

  • Unoptimized MySQL databases with large tables or missing indexes

  • Improper PHP or web server settings

  • Excessive use of modules or custom code

  • Lack of periodic maintenance or cleanup

Identifying which area is affecting your instance is crucial for applying the correct fix. Let’s now explore how to optimize each of these problem areas, step by step.


3. Step 1: Optimize Server Infrastructure

The first step in improving Dolibarr’s performance is ensuring your hosting environment is robust and properly tuned.

3.1 Choose the Right Hosting Type

  • Shared Hosting: Not recommended. Limited resources can cause significant latency.

  • VPS (Virtual Private Server): Good for small to medium setups. Choose at least 2 vCPUs and 4 GB RAM.

  • Dedicated Server: Ideal for larger deployments with many users.

  • Cloud-Based VPS (e.g., AWS, DigitalOcean, Hetzner): Offers scalability and better performance tuning.

3.2 Use SSD Storage

Dolibarr relies on fast disk access for:

  • Loading modules

  • Reading/writing session data

  • Storing and retrieving uploaded documents

Switching to NVMe or SSD drives significantly reduces I/O wait times compared to traditional HDDs.

3.3 PHP Version

Dolibarr works best with PHP 8.1 or 8.2. PHP 8+ offers:

  • Better memory management

  • Improved execution speed

  • Faster performance for object-heavy operations

Make sure your hosting supports and is configured to run PHP 8.1+ with necessary extensions (PDO, mbstring, fileinfo, etc.).

3.4 Use a Proper Web Stack

Recommended stack for high performance:

  • Nginx + PHP-FPM + MariaDB/MySQL

  • Nginx offers better performance than Apache in most scenarios.

  • PHP-FPM allows efficient process management.

If you're using Apache, enable mod_deflate and mod_expires to improve content delivery.


4. Step 2: Clean and Configure the Dolibarr Database

Dolibarr’s performance is closely tied to the health of its MySQL or MariaDB database. As your ERP accumulates records over time (invoices, users, logs, etc.), it may slow down if not properly maintained.

4.1 Enable Query Caching

In your my.cnf or my.ini:

ini

query_cache_type = 1 query_cache_limit = 1M query_cache_size = 64M

Query caching reduces repetitive query overhead.

4.2 Optimize Database Tables

Use tools like phpMyAdmin, Adminer, or CLI to:

  • Run OPTIMIZE TABLE on large tables (e.g., llx_facture, llx_actioncomm)

  • Remove or archive old records no longer needed

  • Repair corrupted tables with REPAIR TABLE

4.3 Add or Rebuild Indexes

Some custom modules or large instances benefit from additional indexing on columns that are frequently used in WHERE clauses or joins.

Use:

sql

EXPLAIN SELECT ...;

...to analyze slow queries, then add indexes as needed.

4.4 Enable InnoDB (if not already)

InnoDB is more efficient than MyISAM for transactional systems like ERP. If your Dolibarr tables are still in MyISAM, convert them:

sql

ALTER TABLE llx_facture ENGINE=InnoDB;

InnoDB offers row-level locking and crash recovery, improving consistency and speed.


5. Step 3: Fine-Tune PHP, Apache/Nginx, and MySQL Settings

Even if your server is powerful, bad configuration can destroy performance.

5.1 PHP Configuration (php.ini)

  • memory_limit = 512M (or higher for larger instances)

  • max_execution_time = 120

  • opcache.enable = 1

  • opcache.memory_consumption = 128

  • opcache.interned_strings_buffer = 16

  • opcache.max_accelerated_files = 10000

Opcache can dramatically improve PHP performance by caching compiled scripts.

5.2 MySQL/MariaDB Settings

In my.cnf:

ini

innodb_buffer_pool_size = 1G innodb_log_file_size = 256M max_connections = 150 slow_query_log = 1

Adjust innodb_buffer_pool_size to be around 60–70% of your RAM if the server is dedicated.

5.3 Web Server Tweaks

Apache:

  • Enable compression:

    apache

    AddOutputFilterByType DEFLATE text/html text/plain text/xml
  • Use KeepAlive:

    apache

    KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 5

Nginx:

  • Enable gzip and leverage caching headers

  • Use FastCGI cache if appropriate

  • Set static asset expiration headers

These adjustments reduce server load and improve page load times.

6. Step 4: Improve Dolibarr Configuration and Module Usage

Once your server and database are tuned, it's time to focus on the Dolibarr application itself. Poor internal configuration can bottleneck performance, regardless of server power.

6.1 Disable Unused Modules

Every active module adds menu items, database queries, and resources that must load on each request.

Go to:
Home > Setup > Modules/Applications

Review active modules and deactivate anything not in use, especially:

  • Experimental or demo modules

  • Unused email or social tools

  • Deprecated add-ons

Fewer active modules = faster UI rendering and fewer background processes.


6.2 Use Cached Menus and Reduced Interface Load

Dolibarr dynamically builds menus based on permissions and modules. On large systems, this process becomes slow.

To reduce UI load:

  • Avoid assigning dozens of permissions to each user role.

  • Consolidate roles into profiles with minimal scope.

  • Encourage users to use bookmarks for frequent pages instead of navigating through menus.


6.3 Optimize Document and File Management

Large file attachments or improperly managed document folders can slow down both Dolibarr and backup processes.

Recommendations:

  • Store uploaded files outside the web root with proper permissions

  • Use structured directories by year or module

  • Periodically archive old documents into ZIP files or external storage

  • Use the Dolistore document cleaner module to remove orphaned or duplicate documents


6.4 Audit Custom Modules and Templates

Many performance issues come from poorly written third-party modules or custom PDF templates that:

  • Run inefficient queries

  • Load too many joins or file reads

  • Output unnecessary debug data

Run tests using Dolibarr’s developer mode:

php

define('DOL_DEVELOPER_MODE', true);

Then check the page generation time and memory usage shown at the bottom of each page.

Refactor or replace poorly performing modules when needed.


6.5 Limit Auto-Reloads and Email Notifications

If your system is configured to:

  • Send many notifications on task creation or invoice changes

  • Auto-refresh dashboards frequently

  • Trigger batch jobs every few minutes via cron

...you may overload your system without realizing it.

Instead:

  • Adjust cron frequency to every 15 or 30 minutes unless real-time updates are needed

  • Consolidate notifications using daily summary emails

  • Use log rotation for email and system logs

These small adjustments can reduce server strain significantly.


7. Step 5: Monitor, Maintain, and Automate Performance Checks

Long-term Dolibarr performance depends on proactive maintenance, not just one-time fixes.

7.1 Regular Maintenance Tasks

Create a monthly or quarterly checklist:

  • Optimize and repair all tables

  • Check for unused or inactive users

  • Review the size of uploaded documents folder

  • Audit admin logs for heavy queries

  • Remove expired draft invoices, orders, and projects

You can automate many of these tasks via cron jobs or scripting tools (PHP, Python).


7.2 Enable Slow Query Logging

Enable MySQL’s slow query log:

ini

slow_query_log = 1 long_query_time = 2 log_output = FILE

This will show you which queries take longer than 2 seconds to execute—perfect for identifying custom modules or reports causing slowness.

Use tools like:

  • mysqldumpslow

  • pt-query-digest

  • Dolibarr's internal SQL log (in dev mode)


7.3 Use External Monitoring Tools

You can monitor performance and uptime using tools like:

  • UptimeRobot: External ping every 5 minutes

  • Netdata or Grafana: Real-time resource monitoring

  • New Relic (PHP integration) for deep application insight

  • Zabbix or Nagios for enterprise-grade setups

These tools give visibility into CPU spikes, memory usage, query overloads, and failed cron jobs.


7.4 Schedule Performance Audits Post-Upgrade

Each time you upgrade Dolibarr (e.g., from version 22.x to 23.x):

  • Test major features in a staging environment first

  • Use a checklist to compare page load time before/after

  • Re-optimize the database (schema changes may impact indexing)

  • Revisit cron and task frequency settings

Upgrades can add overhead—but with the right planning, you’ll gain new features without sacrificing speed.


8. Final Thoughts

Dolibarr is a flexible, powerful, and cost-effective ERP, but performance doesn’t manage itself. Over time, as your business grows and data accumulates, slowness can creep in quietly—hurting productivity, frustrating users, and increasing admin time.

The good news is: with the right approach, Dolibarr can be blazingly fast, even with hundreds of users and thousands of records.

Here’s a quick summary of what to do:

  1. Upgrade your infrastructure: Use PHP 8+, SSDs, and a tuned web stack.

  2. Optimize your database: Clean, index, and monitor query performance.

  3. Tune your server configuration: PHP, MySQL, and Apache/Nginx need proper setup.

  4. Clean up Dolibarr itself: Disable unused modules, audit custom code, and manage documents smartly.

  5. Automate performance monitoring: Stay ahead of problems before they hurt your operations.

By applying these 5 strategic steps, you can transform Dolibarr from sluggish to high-performing, giving your users a better experience and your business the digital reliability it deserves.