In today's world of Odoo usage, performance is contingent upon how the system deals with concurrency. For example, an Odoo instance that functions perfectly well with a few users may not perform well when the user count increases. The dashboards will take time to load, reporting may be slower, and the background tasks will need more resources. Proper worker configuration will help to optimize the performance of Odoo 19.
Why Worker Configuration Matters
By default, Odoo operates in multithreaded mode that suits more developers than end-users in terms of development, demonstration, and testing. This mode does not allow for the full utilization of available hardware.
For production deployments on Linux, Odoo provides multiprocessing mode. It creates multiple processes so that several requests can be handled at the same time.
Without proper worker configuration, users may experience:
- Slow page loading
- Request timeouts
- Slow report generation
- Delayed background processing
- Higher server resource usage
Types of Workers in Odoo
Odoo implements different techniques to deal with various loads.
HTTP Workers
These workers handle standard requests from users and API like opening form views, creating records, viewing dashboards, and generating reports. The number of HTTP workers is set using the workers parameter in the odoo.conf file.
workers = 4
Cron Workers
Cron workers handle scheduled actions such as automated tasks and scheduled emails. Their number is controlled using:
max_cron_threads = 2
In multiprocessing mode, these processes are separate from the HTTP workers.
Live Chat / WebSocket Worker
Odoo also starts a dedicated Live Chat worker in multiprocessing mode. It listens on the configured gevent port and is used for real-time communication. When using a reverse proxy, WebSocket requests should be routed correctly to this worker.
How to Calculate the Number of Workers
There is no fixed worker count suitable for every Odoo server. CPU, memory, concurrent users, custom modules, and workload should all be considered.
Odoo provides this common rule of thumb:
workers = (CPU cores × 2) + 1
For example:
- 2 CPU cores - 5 workers
- 4 CPU cores - 9 workers
- 8 CPU cores - 17 workers
Odoo also gives a general guideline of approximately 6 concurrent users per worker. These are starting points, not fixed values. Actual performance should be monitored under real workloads.
Memory Considerations
Worker scaling also depends heavily on available RAM. Odoo estimates that a lighter worker may use around 150 MB, while a heavier worker can use around 1 GB, depending on the workload.
Therefore, memory should be planned for Odoo workers as well as PostgreSQL and the operating system.
The following parameters can help control worker resource usage:
- limit_memory_soft
- limit_memory_hard
- limit_time_cpu
- limit_time_real
These limits help prevent individual workers from consuming excessive resources or running requests for too long.
Scaling Beyond a Single Server
Adding more CPU, RAM, or workers is known as vertical scaling. When a single server is no longer sufficient, Odoo can also be deployed across multiple application servers behind a load balancer such as Nginx or HAProxy.
A multi-server setup should consider:
- Shared filestore or suitable object storage
- PostgreSQL capacity and connections
- Correct WebSocket routing
- Session handling
- Load balancing between Odoo servers
Monitoring Worker Performance
After configuring workers, monitor the server under realistic workloads.
ps aux | grep odoo | grep -v grep
watch -n 2 'ps aux --sort=-%mem | grep odoo'
You should also monitor CPU usage, RAM consumption, PostgreSQL connections, response times, and Odoo logs.
Scaling workers in Odoo 19 requires a proper balance of CPU, memory, database capacity, and the number of users. Although using more workers increases concurrency, it can also consume more system resources. A poor configuration of workers may mean high usage of memory and database resources. The proper configuration of Odoo will lead to good Odoo performance.
To read more about How to Set Up Workers in Odoo 19 for Better Performance, refer to our blog How to Set Up Workers in Odoo 19 for Better Performance.