Skip to Content

Odoo Performance: Optimize for Speed and Scalability

Slow Odoo costs productivity

Odoo can be fast. It can also be terribly slow. The difference comes down to configuration, infrastructure, and how the code is written. Here are the most common bottlenecks and how to fix them.

Workers

In odoo.conf: workers = 4 (or more, depending on CPU cores). Without workers, Odoo runs single-threaded and can only handle one request at a time. Rule of thumb: CPU cores times 2 plus 1. A longpolling worker is needed separately.

PostgreSQL optimization

The default PostgreSQL configuration is sized for a laptop, not a production server. Adjust: shared_buffers (25% of RAM), effective_cache_size (75% of RAM), work_mem (4 to 16 MB depending on queries), maintenance_work_mem. The PGTune tool gives suggestions based on your server.

Indexes

Missing indexes are the most common cause of slow queries. EXPLAIN ANALYZE on slow queries shows if a sequential scan happens where an index should exist. Custom modules adding fields that are filtered on should have index=True on the field.

Caching

Odoo caches QWeb templates, assets (CSS/JS), and metadata. In production: --db-filter to restrict to one database (reduces memory usage). Nginx in front with caching of static files. CDN for images and assets.

Memory leaks

limit_memory_hard and limit_memory_soft in odoo.conf. Workers exceeding the hard limit are killed and restarted. Without these settings, a single worker can eat all available memory. Set soft to 640 MB and hard to 768 MB as a starting point.

Measure

Log slow queries: log_min_duration_statement = 100 in postgresql.conf shows all queries taking over 100 ms. Odoo log with --log-level=debug for RPC calls shows which methods take time.

Odoo Email Configuration: SMTP, Aliases, and Catchall
Without working email, nothing else works