Blog
Odoo Performance Tuning: Why It Gets Slow and How to Fix It
Odoo slow? Learn the usual causes - worker settings, PostgreSQL, custom code, missing indexes - and the order to fix them in, with honest limits.
- mid
- odoo
Short answer: Odoo is rarely slow because of “Odoo” in general. It is usually slow because of one of four things: a server with too few or badly configured workers, a PostgreSQL database running on defaults, custom code that runs queries inside loops, or tables that have grown without the right indexes. Measure first, then fix the cheapest cause first.
This article gives you a practical order of operations. It is written for owners and operations or IT leads who run Odoo (self-hosted or on a managed host) and want to know what is worth checking before paying for more hardware.
Step 0: Find out what is actually slow
“Odoo is slow” can mean a dozen different things. Before changing anything, write down:
- Which screen or action is slow (a list view, a report, a sales order confirmation, an import)?
- Is it slow for everyone or one user? All day, or only at peak hours?
- Did it start after a module install, an upgrade, or a data import?
Odoo ships with a built-in profiler. According to the Odoo developer documentation on performance, it records executed SQL queries and stack traces, and you can switch it on from developer mode for web requests. The same page notes that profiling does not make anything faster by itself; it tells you which code is responsible. It is also not available on Odoo Online databases.
If a single action is slow for everyone, suspect code or database. If everything is slow at busy times, suspect server sizing and workers.
Cause 1: Worker and memory settings
Production Odoo should not run in single-process mode. Odoo’s deployment documentation gives a rule of thumb for the number of workers: (number of CPUs x 2) + 1, with the note that cron workers also need CPU, and a rough guide of about 6 concurrent users per worker.
The same page offers a memory estimate that assumes roughly 20% of requests are heavy and 80% light, with a heavy worker around 1 GB of RAM and a light one around 150 MB. Those are estimates, not guarantees. Your own mix of reports and imports may be heavier.
The settings that matter most:
| Setting | What it does | Documented sample value |
|---|---|---|
workers | Number of HTTP worker processes | Rule of thumb above |
limit_memory_soft | Worker is recycled after a request when it exceeds this | 629145600 (about 600 MB) |
limit_memory_hard | Worker is killed when it exceeds this | 1677721600 (about 1.6 GB) |
limit_time_cpu | Max CPU seconds per request | 600 |
limit_time_real | Max wall-clock seconds per request | 1200 |
Treat those sample values as a starting point, not a recommendation for your workload. Two common mistakes:
- Too many workers for the RAM. Each worker loads the full Python environment. If the machine starts swapping, everything gets slower, and adding workers makes it worse.
- Limits set so low that heavy reports get killed. Users then report random failures on month-end reports, not slowness.
Cause 2: PostgreSQL left on defaults
Odoo is a database application. Many “Odoo is slow” problems eventually lead to PostgreSQL. A stock PostgreSQL install is configured conservatively to run on almost any machine, not to use your 32 GB of RAM.
Settings to review:
shared_buffers: the PostgreSQL documentation suggests that on a dedicated server with 1 GB or more of RAM, 25% of system memory is a reasonable starting value.work_memandeffective_cache_size: these depend on your RAM and concurrency. A generator such as PGTune can give a baseline, but verify it against your own workload.max_connections: Odoo’s sample configuration uses 80, and each Odoo worker opens its own connections, so make sure the two sides agree.
Also keep autovacuum healthy. Odoo tables with heavy updates (stock moves, accounting lines, mail messages) bloat if vacuuming falls behind. Large, old tables like mail_message and ir_attachment metadata are common culprits for slow searches.
One honest caveat: database tuning is workload-specific. Blog posts that promise a fixed percentage speed-up from a config change are guessing. Change one thing at a time and measure.
Cause 3: Custom code and modules
If the slowness is tied to one screen and started after a customisation, the code is the likely cause. The usual pattern is a query inside a loop. The Odoo performance documentation describes this under “Batch operations”: avoid running SQL-triggering methods inside a loop over a recordset. Its example is replacing a per-record search_count with a single grouped read, collecting values and calling create once on the whole batch, and browsing the full recordset before reading fields so prefetching loads them in one query.
Here is the shape of the problem in simplified form:
# Slow: one query per partner
for partner in partners:
partner.order_count = self.env["sale.order"].search_count(
[("partner_id", "=", partner.id)]
)
# Better: one grouped query for all partners
groups = self.env["sale.order"]._read_group(
[("partner_id", "in", partners.ids)],
groupby=["partner_id"],
aggregates=["__count"],
)
counts = {partner.id: count for partner, count in groups}
for partner in partners:
partner.order_count = counts.get(partner.id, 0)
The same documentation also warns about nested loops: build a dictionary keyed by ID rather than searching a list inside a loop, and use sets for membership checks.
Other code-level suspects:
- Computed fields that are not stored but are used in list views, filters or reports.
- Automated actions and server actions that fire on every write.
- Third-party modules that were never tested against your data volume. Ask what a module does on
writeandcreate.
If you did not write the code, ask whoever did to show you the profiler output for the slow action. A competent developer can do this in minutes.
Cause 4: Missing indexes and data growth
Something that was fast with 5,000 records can crawl at 5 million. Adding index=True to a field can speed up searches from both code and the user interface, according to Odoo’s performance documentation. The same page warns not to index every field, because indexes take space and slow down INSERT, UPDATE and DELETE.
Practical approach: use the profiler or PostgreSQL’s slow query log to find the specific slow query, look at its filter and sort columns, and index those. Do not index speculatively.
Data growth also needs housekeeping: archive old records, clear out old logs and failed mail queue entries, and review scheduled actions that process the same large backlog every run.
Cause 5: Infrastructure around it
Less common, but worth a check:
- Database and app on a slow disk. PostgreSQL likes fast storage. Network-attached storage with high latency can hurt noticeably.
- No reverse proxy or compression. A proxy such as Nginx in front of Odoo, serving static assets with caching, takes load off the workers. The deployment documentation covers this setup.
- Cron jobs competing with users. Heavy scheduled actions during business hours steal CPU from interactive requests. Move them to off-peak times.
- Hosting limits. On managed hosting, worker count and storage are often fixed by your plan. Check what your plan allows before assuming you can tune it.
A sensible order of operations
- Reproduce and measure with the profiler. Note the exact slow action.
- Check server resources during the slowdown: CPU, RAM, swap, disk wait.
- Review worker count and memory limits against available RAM.
- Review PostgreSQL settings and autovacuum.
- Profile and fix custom code, starting with queries inside loops.
- Add targeted indexes for the specific queries you found.
- Only then consider bigger hardware or splitting the database and app servers.
Buying a bigger server first is the expensive guess. It sometimes works, but if the cause is a loop issuing thousands of queries, you have just made the same slow code run on a more costly machine.
When tuning is not enough
Sometimes the honest answer is that the setup has outgrown its design: very large transaction volumes on one database, heavy reporting that should run on a replica or a separate analytics tool, or a heavily customised system that needs a code review. That is a bigger conversation, but it is still cheaper to have it after you have real measurements.
Talk it through with us
If your Odoo system is slow and you are not sure where to start, we are happy to have a no-charge conversation about what you are seeing. We will tell you plainly whether it sounds like a configuration issue, a code issue or a sizing issue, and whether you need outside help at all.
Sources: Odoo 18 developer documentation: Performance; Odoo 18 documentation: Deploying (system configuration, workers and limits); PostgreSQL documentation: Resource consumption. Configuration values and defaults change between Odoo and PostgreSQL versions and depend on your workload; verify against the primary sources for your version before changing a production system.