Skip to main content
iVentureTeam
Odoo Performance

Odoo Performance Tuning Checklist: Workers, Memory and PostgreSQL

Odoo performance tuning checklist for Odoo 19 and 20: workers formula, memory limits, PostgreSQL and PgBouncer, allocator tests and slow query fixes.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
November 16, 202615 min read3 views
Odoo Performance Tuning Checklist: Workers, Memory and PostgreSQL cover

When users say "Odoo is slow", the cause is rarely one setting. It is usually a mix of too few or too many workers, memory limits that kill requests, a default PostgreSQL setup and a few heavy reports. Our Odoo support and performance optimization team works through it in a set order.

Related service: Odoo optimization services — performance audits, PostgreSQL tuning and faster screens.

This guide is for IT leads and system admins who run Odoo 19 or Odoo 20 on Odoo.sh or their own servers. If you are still working out Odoo server requirements for a large rollout, read how far Odoo can scale to 500 or 1,000 users first; this post is about tuning a system that already runs.

What is the Odoo performance tuning checklist, in order?

Odoo performance tuning: Key settings, defaults and starts

The Odoo performance tuning checklist runs from measurement to code: baseline, workers, memory limits, PostgreSQL, connections, allocator, slow queries, retest. The order matters, because a slow query can look like a worker shortage and a bad memory limit can look like a slow query.

  1. Baseline: time 8 to 10 key actions on a staging copy and save the numbers.
  2. Workers: switch to multi-processing and size HTTP and cron workers to your CPU.
  3. Memory limits: set per-worker soft and hard limits that fit your RAM.
  4. Time limits: set limit_time_cpu and limit_time_real so heavy reports finish but runaway requests stop.
  5. PostgreSQL: set shared_buffers, effective_cache_size, work_mem and autovacuum for your data size.
  6. Connections: budget db_maxconn against max_connections, and add PgBouncer only where it is safe.
  7. Allocator: optionally test mimalloc or a lower glibc arena count.
  8. Slow queries: log, rank and fix the worst statements and the code that calls them.
  9. Retest: repeat the baseline and keep only the changes that helped.

The table lists the main settings, their defaults and where we usually start. Treat the starting points as our working defaults, not hard rules.

SettingDefaultWhere to start
workers0 (multi-threaded mode)(CPU cores x 2) + 1 in total, including cron
max_cron_threads21 or 2, counted inside the CPU budget
limit_memory_soft2048 MiB per workerOdoo sample: 600 MiB (629145600 bytes)
limit_memory_hard2560 MiB per workerOdoo sample: 1,600 MiB (1677721600 bytes)
db_maxconn64 per Odoo processLower it so all processes fit under max_connections
shared_buffersTypically 128 MBAbout 25% of RAM on a dedicated database server
work_mem4 MBRaise with care, as each sort or hash can use it

How do you measure Odoo performance before you tune it?

Measure Odoo performance with a repeatable baseline on a copy of production, or you cannot prove any change helped. Without numbers, tuning turns into guessing, and some changes make things worse.

Restore production into a staging database and neutralize it, so no emails, payments or crons leave the copy. Our Odoo staging environment checklist covers that step.

Then record the baseline:

  • Key actions: open the sales list, confirm an order, validate a delivery, post an invoice, run the aged receivables report, and open the website shop.
  • Timings: run each action 3 times and note the median and the slowest time.
  • Load: if you can, replay 10, 25 and 50 simultaneous users with a load tool and record the 95th percentile response time.
  • Server: CPU load, RAM in use, swap, open PostgreSQL connections and disk wait.
  • Logs: count worker restarts and memory-limit messages in the Odoo log.

Keep the dataset, the user count and the time of day the same for every run. Change one setting, rerun the same script and compare.

How many Odoo workers do you need?

Odoo workers configuration starts from Odoo's rule of thumb: (CPU cores x 2) + 1 workers, and about 6 concurrent users per worker. Cron workers need CPU too, so they come out of the same budget.

Odoo's deployment guide gives a worked example. A server with 4 CPU cores and 60 concurrent users needs 10 workers in theory (60 / 6), but the CPU caps it at 9. Odoo uses 8 HTTP workers plus 1 cron worker and watches CPU load.

CPU coresMax workers by formulaExample splitUsers at 6 per HTTP worker
254 HTTP + 1 cronAbout 24
498 HTTP + 1 cronAbout 48
81715 HTTP + 2 cronAbout 90
163331 HTTP + 2 cronAbout 186

The default is workers = 0, which runs the multi-threaded server. Odoo says this mode is mainly for development and does not make the best use of the hardware because of Python's GIL. For production, set workers above 0.

Turning on workers also starts a separate gevent worker for websockets on port 8072. Your proxy must send paths starting with /websocket/ to that port, and Odoo must run with proxy_mode on. Skip this and chat, notifications and the bus misbehave.

One Odoo 15 user on the forum found that Odoo became very slow when workers were activated, with 60 seconds to refresh a page while CPU and RAM sat near 20%. When we see this pattern, we first check the websocket proxy routing and the database connection limits.

How should you set Odoo memory limits?

Odoo memory usage is controlled per worker by limit_memory_soft and limit_memory_hard, and these values must never be multiplied by the number of workers. Get them wrong and workers are either killed mid-request or allowed to swell until the server swaps.

The Odoo command-line reference defines both limits as virtual memory per worker. Past the soft limit, a worker is recycled after its current request. Past the hard limit, it is killed at once. Defaults are 2048 MiB soft and 2560 MiB hard.

To size total RAM, Odoo assumes 20% heavy requests at about 1 GB and 80% light ones at about 150 MB. For 9 workers that is 9 x ((0.8 x 150) + (0.2 x 1024)), or about 3 GB for Odoo alone, before PostgreSQL and the operating system.

A common mistake shows up in an Odoo 12 thread where server memory kept rising and never dropped. The top answer multiplied the per-worker limits by 9; a later reply corrected it, since the limits already apply to each worker.

The time limits matter as much:

  • limit_time_cpu: CPU seconds per request, default 60. Raise it only for known heavy reports.
  • limit_time_real: wall time per request, including SQL, default 120.
  • limit_request: requests a worker serves before it is recycled; the Odoo 19 and 20 source sets 65,536, while the docs still say 8196.
  • limit_time_real_cron: separate wall time for cron jobs; the default of -1 follows limit_time_real, and 0 means no limit.

If heavy reports keep hitting the limit, fix the report rather than raising limits for every request. Odoo 19 and 20 also offer limit_memory_soft_gevent for the websocket worker, which defaults to the normal soft limit.

Which PostgreSQL settings matter most for Odoo?

For Odoo, the PostgreSQL settings that matter most are shared_buffers, effective_cache_size, work_mem, maintenance_work_mem, max_connections and autovacuum. Most servers still run the stock values, which are sized for a small machine.

SettingPostgreSQL defaultWhat it doesOdoo starting point
shared_buffersTypically 128 MBDatabase page cacheAbout 25% of RAM, rarely above two fifths
effective_cache_size4 GBPlanner's guess of total cacheRoughly shared_buffers plus free OS cache
work_mem4 MBMemory per sort or hash stepRaise slowly; many steps can run at once
maintenance_work_mem64 MBVACUUM and index buildsHigher is usually safe
random_page_cost4.0Cost of random readsLower can suit SSDs with data in cache
max_connectionsTypically 100Total client connectionsFit Odoo's processes plus a reserve

The PostgreSQL manual says a reasonable starting value for shared_buffers on a dedicated server with 1 GB or more of RAM is 25% of memory. It adds that more than two fifths of RAM is unlikely to help, because PostgreSQL also relies on the operating system cache.

Be careful with work_mem. PostgreSQL warns that one complex query can run several sorts and hashes at once, each allowed that much memory, and many sessions can do so together. A large global value can push the server into swap.

Keep autovacuum on. Odoo tables such as mail_message, stock_move and account_move_line grow fast, and stale statistics lead to bad query plans. If the filestore and database are also growing fast, our guide to Odoo.sh storage cleanup helps.

How do db_maxconn, max_connections and PgBouncer fit together?

Odoo's db_maxconn sets how many PostgreSQL connections each Odoo process may open, and the total across all processes must stay below PostgreSQL's max_connections. PgBouncer can help, but only in a mode that keeps Odoo's bus working.

The default db_maxconn is 64 per process. With 8 HTTP workers, 1 cron worker and the gevent worker, that allows up to 640 connections in theory, while PostgreSQL usually allows 100. Odoo's own sample sets max_connections to 80.

Our rule of thumb: (HTTP workers + cron workers + 1) x db_maxconn should stay under max_connections, with room left for backups and admin tools. With 10 processes, db_maxconn = 6 gives 60 connections. Odoo 19 and 20 also have db_maxconn_gevent for the websocket worker.

PgBouncer has three pooling modes. Session mode supports every PostgreSQL feature but pools less. Transaction mode pools well but never supports LISTEN, SET or session advisory locks. The Odoo bus runs LISTEN on the imbus channel, so transaction mode can break chat and real-time updates.

That is exactly what one admin reported in a thread on Odoo with PgBouncer, cron and chat: session mode worked but gave no pooling benefit, and transaction mode stopped cron and chat. A safer pattern is to point the gevent worker straight at PostgreSQL and pool only HTTP workers, then test.

Should you change the memory allocator for Odoo?

Swapping the memory allocator for Odoo, for example to mimalloc, can lower memory use for some workloads, but you must prove it on your own system first. Treat it as a step 7 option, after workers, limits and PostgreSQL are right.

Some Odoo hosts report lower memory use with mimalloc in early internal tests, but without published setup, versions or benchmarks. That is a reason to test, not proof.

On Linux there are two common options:

  • mimalloc: preload the library for the Odoo service, for example LD_PRELOAD=/usr/lib/libmimalloc.so in the systemd unit, as the mimalloc project documents.
  • glibc arenas: keep the default allocator but cap its arenas with GLIBC_TUNABLES=glibc.malloc.arena_max=2, the newer form of MALLOC_ARENA_MAX.

Run the same baseline test before and after, for at least a few working days. Compare resident memory per worker, how often workers recycle on memory limits, and the 95th percentile response time. If any of them gets worse, roll back.

You can only do this on Odoo.sh Dedicated or your own servers, where you control the service environment. On Odoo Online and shared Odoo.sh, Odoo manages the runtime.

How do you find slow queries in Odoo?

Find slow queries in Odoo by logging long statements in PostgreSQL, ranking them with pg_stat_statements, then tracing them back to code with the Odoo profiler. Most "Odoo slow" tickets end at a handful of queries or one custom compute method.

  1. Log long statements: set log_min_duration_statement to 500 ms or 1 s, so PostgreSQL logs every statement that runs longer.
  2. Rank them: enable pg_stat_statements in shared_preload_libraries (needs a restart) and sort by total time, not just by the slowest single run.
  3. Explain them: run EXPLAIN (ANALYZE, BUFFERS) on the top statements in staging and look for sequential scans on large tables.
  4. Trace the code: turn on the Odoo profiler in developer mode and open the flame graph for the slow action.
  5. Fix: add an index where a filtered field has none, batch writes inside loops, or store a computed field that is searched often.

Odoo's guide warns not to index every field, as indexes use space and slow inserts, updates and deletes. It also notes that Odoo Online databases cannot be profiled. Use --log-sql only on staging, as it logs every query.

For older or heavily customized systems, a structured Odoo audit checklist helps you decide whether the problem is configuration, data or custom code.

What can you tune on Odoo Online, Odoo.sh and on-premise?

How much Odoo performance optimization you can do depends on hosting: almost none on Odoo Online, workers and plan size on Odoo.sh, and everything on your own servers. Check this before you plan the work.

Tuning areaOdoo OnlineOdoo.shOn-premise
WorkersManaged by OdooBought per worker, 1 to 16 on shared hostingYou set them
Memory and time limitsManaged by OdooManaged with the platformYou set them
PostgreSQL settingsManaged by OdooManaged by OdooYou set them
PgBouncer or allocatorNoNot on shared hostingYes
Odoo profilerNot availableYesYes
Staging copies for testsDuplicate database0 to 20 staging environmentsAs many as you build

On Odoo.sh pricing, workers are priced per worker per month, and more than 16 workers needs the Dedicated hosting type. Our Odoo Online vs Odoo.sh vs on-premise comparison covers the wider hosting choice.

Which industries hit Odoo performance limits first?

Businesses with heavy scheduled jobs, busy websites or very large stock and accounting tables hit Odoo performance limits first. The fix differs by where the load comes from.

IndustryPain or cost driverOdoo approachHow iVentureTeam helps
eCommerce and retailWebsite traffic and websocket load at peaksSeparate gevent worker, proxy caching for static filesSize workers for peaks, route /websocket/ correctly
ManufacturingMRP scheduler and work order crons at nightDedicated cron workers, longer cron time limitsSplit heavy crons, profile planning runs
DistributionLarge stock_move and valuation tablesIndexes, autovacuum, stored computed fieldsRank slow queries, fix custom reports
Finance-heavy groupsAged balance and ledger reports on years of dataHigher work_mem for report users, archivingTune report queries, plan data archiving
Multi-branch POSMany sessions syncing at opening and closingEnough HTTP workers and connectionsTest opening-hour load before rollout

Odoo performance tuning in practice: a before and after test log

In practice, every change goes into a simple test log with the same script, the same data and a clear keep-or-roll-back rule. The template below is what we fill in during a tuning engagement.

StepWhat you changeWhat you measureKeep it if
0. BaselineNothingMedian and slowest time for 8 to 10 actions, CPU, RAMn/a
1. Workersworkers, max_cron_threads95th percentile at 25 and 50 usersResponse time drops, CPU stays below saturation
2. Memory limitslimit_memory_soft, limit_memory_hardWorker recycles per hour, swapFewer killed requests, no swap
3. PostgreSQLshared_buffers, work_memReport run times, cache hit ratioReports faster, no swap
4. Connectionsdb_maxconn, PgBouncerPeak connections, chat and cron still workUnder max_connections, bus intact
5. AllocatorLD_PRELOAD or arena_maxResident memory per worker over daysLower memory, same or better speed
6. QueriesIndexes, code fixesTop 10 statements by total timeTotal time drops

Run each step on staging, then repeat the winning settings on production at a quiet hour and rerun the baseline. You can see how we document client projects in our Odoo project case studies.

How iVentureTeam helps with Odoo performance tuning

Odoo feeling slow? Run a health check

iVentureTeam tunes Odoo from the server up to the code, and proves each change with a before and after test. We have delivered 150+ ERP projects across 35+ countries with 40+ Odoo specialists, led by a consultant with 13+ years in Odoo.

  • Free first look: start with our Odoo health check tool to spot version, module and setup risks.
  • Baseline and load test: scripted tests on a neutralized staging copy, with numbers you can keep.
  • Server and database tuning: workers, limits, PostgreSQL, pooling and allocator tests on Odoo.sh Dedicated or your own servers, backed by our DevOps services.
  • Slow code fixes: profiling, indexes and rewrites of slow custom modules and reports.
  • Ongoing monitoring: performance and security monitoring under an Odoo support plan.

The bottom line on Odoo performance tuning

Odoo performance tuning is a measured sequence, not a single magic setting: baseline, workers, memory limits, PostgreSQL, connections, then slow queries. Allocator swaps come last and only with proof.

Most slow Odoo systems improve a lot from the first five steps on the checklist. Write down your baseline today, change one thing at a time, and keep only what your numbers support.

Ready to make your Odoo system faster?

Ask for a performance review

Get a measured tuning plan for your workers, memory and database. Ask for an Odoo performance review, call +91-90235-15208, or email business@iventureteam.com.

Frequently Asked Questions

How many workers should Odoo have?

+

Odoo's rule of thumb is (CPU cores x 2) + 1 workers in total, with about 6 concurrent users per worker. A 4-core server with 60 users gets 8 HTTP workers plus 1 cron worker in Odoo's own example.

Why is my Odoo so slow?

+

The usual causes are workers left at 0, memory limits that kill heavy requests, default PostgreSQL settings, too many database connections, and slow custom reports. Measure a baseline first, then work through them one at a time.

How much RAM does Odoo need?

+

Odoo estimates about 150 MB for a light worker and 1 GB for a heavy one, with 20% heavy requests. Nine workers need about 3 GB for Odoo alone, plus RAM for PostgreSQL and the operating system.

What are limit_memory_soft and limit_memory_hard in Odoo?

+

They are per-worker virtual memory limits. Past the soft limit, the worker restarts after its current request; past the hard limit, it is killed at once. Defaults are 2048 MiB and 2560 MiB.

Should I use PgBouncer with Odoo?

+

It can help large setups, but transaction mode does not support LISTEN, which the Odoo bus uses. Use session mode or connect the gevent worker straight to PostgreSQL, and test chat and crons on staging first.

What is db_maxconn in Odoo?

+

It is the maximum number of PostgreSQL connections each Odoo process may open, 64 by default. Multiply it by your process count and keep the total below PostgreSQL's max_connections.

Does mimalloc make Odoo faster?

+

Some hosts report lower memory use in early internal tests, but results depend on the workload. Preload it on a staging server, compare memory and response times over several days, and roll back if anything gets worse.

Can I tune performance on Odoo Online?

+

Very little. Odoo manages the servers, and the Odoo profiler is not available on Odoo Online. You can still clean data, archive old records and simplify slow custom reports built in Studio.

Free Odoo support review

Need dependable Odoo support?

Tell us what's going wrong or what you need covered. We suggest a support plan that fits how you use Odoo.

Free, with no obligation. A senior consultant replies within 12 business hours.

We use cookies to improve your experience

Essential cookies make the site work, and we use analytics to improve it. Choose “Only necessary” to turn analytics off. See our cookie policy.