Odoo is one of the most popular and effective ERP software suites available. It has both an enterprise and a community edition. The latter can be used for free. It integrates apps that cover all your business needs in a single package and allows you to manage your company smoothly. If you’re running or planning to run an Odoo instance, you might be affected by serious performance issues as you expand your operations and the flow of data increases. Here are a few tricks to make your Odoo instance faster.
Add more resources
Like all business applications, Odoo can be resource-hungry as the number of users increases. Disk access speed is the usual bottleneck, so make sure your server uses SSD storage and not conventional disk drives, which are a lot slower and will usually cause poor performance even with ideal configuration settings.
RAM and CPU cores are also very important and you’ll have to scale up resources if your business grows. For example, 2 CPU cores and 2 GB RAM are enough for a site with no more than 5 users, while one with 20 users needs at least 4 cores and 8 GB of memory. Adding more RAM will always result in a noticeable performance boost.
It is also very important to use a dedicated server for Odoo, since any other software running at the same time will slow it down.
Use your resources
Adding more resources is only the first step, you now have to configure Odoo to use them. Multiprocessing is disabled by default, so instruct your instance to take advantage of all available CPU cores.
Log in to your server through SSH and run the following command:
It will print a long list of options, the important ones are right at the end:
You can specify them as command line options when you start the Odoo process but it’s more convenient to create a configuration file named .odoorc in your home directory.
Setup the number of workers to be equal to the one of CPU cores, while the values for limit_memory_hard and limit_memory_soft depend on the server’s resources.
Don’t allocate all available RAM since the other processes also need some of it to operate properly.
Restart Odoo in order for the configuration changes to be applied.
If you run an instance with many users, you should consider a multi-server architecture.
The simplest options are to move the database to a separate server or to set up a reverse proxy server in front of Odoo in order to serve static assets.
For even better performance, you can add multiple backend servers, here is for example the deploy architecture recommended by Odoo for an application with 300 users:
Eliminate unused apps
Odoo offers dozens of core modules and several thousands have been developed by the community. When you first install the suite, you will be tempted to activate a large number of them.
Keep in mind that every module consumes resources and slows down your system, so delete the ones that you don’t actually use or need.
This can easily done from the GUI, go to Apps in the top menu, click on any particular module and then on the Uninstall button.
You should update your modules regularly in order to benefit from performance improvements and bug fixes. Modules can be easily upgraded from the Apps menu, just click on the Upgrade button. Use the command line and your distribution’s package manager to update PostgreSQL to the latest version.
You should also consider migrating to the current version of Odoo if you’re using an older one. Enterprise edition customers have an official upgrade tool available, while open source tools exist for the community edition but the process is more complicated.
PostgreSQL is the database used by Odoo, some of the configuration options can really speed up your system. From the command line, find and edit the Postgres configuration file (typically located at /etc/postgresql/X.X/main/postgresql.conf).
It is a large file, these are the important parameters that you should edit:
shared_buffers – should be about 20% of the total available memory
effective_cache_size – equal to the file system cache or half of the total RAM
maintenance_work_mem – 10% of the available RAM
You also have to make sure that automatic Vacuuming is disabled. This operation cleans up temporary data but needs to scan all tables, which slows down your system to a halt at inconvenient times. It is better to run Vacuuming manually from time to time.
Restart the PostgreSQL service after editing the file in order for the changes to take effect.
Monitor your server
If you are an advanced user, you can monitor your system using various tools. Odoo developers recommend the command line utility pg_activity that shows running queries and helps you identify slow ones. For server-wide metrics, Munin is an easy to install tool with a friendly user interface.
Running a complex application like Odoo can be a daunting task, following our simple tips will allow you to optimize it even if you are not an experienced system administrator.
Looking for Odoo Hosting? Check out our main site.