Skip to main content
Infrastructure

The architecture behind high-performance Odoo deployments.

Odoo for 500 concurrent users looks nothing like Odoo for 15. The default setup gets you running; it doesn't get you to production at scale. Here's the architecture we use, and the order we tune it in.

By Anvexis Stack Engineering8 min read

The multi-layer stack

Edge

  • Nginx reverse proxy
  • TLS termination
  • Static file caching

Application

  • Multiple Odoo workers
  • Load balancer
  • Dedicated websocket worker

Data

  • PostgreSQL primary
  • Read replicas for reporting
  • Connection pooling

Measure before you tune

Performance work goes wrong when it starts with a solution. Adding servers, caches, or workers to a slow Odoo instance rarely helps if the real problem is one unindexed query or a scheduled job that locks a busy table every few minutes.

Start by measuring which requests are slow, which database queries dominate, when the slowdowns happen, and what the workers are doing at that moment. PostgreSQL's pg_stat_statements module tracks planning and execution statistics for every SQL statement the server runs; it has to be added to shared_preload_libraries, which means a restart, so enable it before you need itSource [3]. Combined with Odoo's request logs and basic server metrics, it usually points to the real bottleneck within a day or two.

PostgreSQL is usually the bottleneck

Default PostgreSQL settings are tuned for modest hardware, not for a busy ERP. The PostgreSQL documentation suggests that on a dedicated database server with 1GB or more of RAM, a reasonable starting value for shared_buffers is 25% of system memorySource [2]. effective_cache_size should reflect the memory actually available for caching, and checkpoint settings should smooth out write bursts.

Be careful with work_mem. It applies to each sort or hash operation, a complex query can run several at once, and many sessions can do so concurrently, so total usage can be many times the configured valueSource [2]. Raising it globally to fix one slow report is a classic way to run a busy server out of memory at month end. Raise it for the specific role or session that needs it instead.

Find the expensive queries

In the Odoo instances we review, a handful of queries usually account for most of the database time. Common culprits are computed fields without stored values on large models, searches on unindexed custom fields, reports that load entire tables into Python, and record rules that add complex joins to every query.

Read the query plans with EXPLAIN ANALYZE, add targeted indexes, store computed fields that are read far more often than they change, and rewrite reports to aggregate in the database instead of in Python. Each fix is small; together they often make a dramatic difference. Our guide to PostgreSQL indexes without tears walks through reading a plan step by step.

How many workers, and how much memory?

Odoo's deployment documentation gives a rule of thumb of (#CPU × 2) + 1 workers, plus a way to estimate memory: a heavy worker is estimated at around 1GB of RAM and a light one at around 150MB, assuming about 20% of requests are heavy and 80% lightSource [1]. Treat both as starting points, not answers.

As a worked example, nine workers would need roughly 9 × (0.8 × 150MB + 0.2 × 1GB), or about 3GB, for Odoo alone, before PostgreSQL, the operating system, and headroom. That arithmetic is why Odoo and PostgreSQL end up on separate machines once an instance gets busy: they compete for exactly the same resource. The memory and time limits in the configuration below exist so a runaway import or report gets its worker recycled instead of taking the server down.

A starting configuration

odoo.confini
[options]
; workers ≈ (CPU cores × 2) + 1, then adjust from measurements
workers = 9
max_cron_threads = 2
; example limits; tune to your heaviest legitimate request
limit_memory_soft = 2147483648
limit_memory_hard = 2684354560
limit_time_cpu = 120
limit_time_real = 240
proxy_mode = True

Connections are a budget too

Every Odoo worker opens its own database connections, and so do cron workers, integrations, backup tools, and reporting software. Add them up before you raise the worker count, because PostgreSQL connections are not free: each one is a separate server process with its own memory. A server configured for 100 connections that suddenly sees 300 will refuse new ones or slow to a crawl.

On larger setups, a connection pooler such as PgBouncer sits between the applications and the database and lets many clients share fewer real connections. It's especially useful for integrations and reporting tools that open and close connections constantly. Keep Odoo's own pool size, the worker count, and PostgreSQL's max_connections in one spreadsheet, and change them together.

Front the application properly

A reverse proxy such as Nginx in front of Odoo handles TLS, compresses responses, serves static assets efficiently, and routes real-time traffic to the right place. In multi-process mode, Odoo runs a dedicated worker for live chat and notifications on its gevent port, and the documentation's sample configuration sends paths starting with /websocket to itSource [1]. Get that wrong and live chat and notifications misbehave under load.

Enable proxy_mode only when Odoo actually sits behind a reverse proxy, so it reads the real client address from the proxy's headersSource [1]. Set sensible timeouts and request size limits at the proxy, and enable HTTP caching for static files. These small settings make a noticeable difference to how responsive Odoo feels, especially for users far from the server.

Separate the noisy neighbours

Users clicking through forms, scheduled jobs crunching data, and integrations pushing thousands of records all compete for the same workers and database. When a heavy job runs, everyone feels it.

Run scheduled jobs and queue jobs on dedicated workers, move heavy work outside business hours where possible, and give integrations their own rate limits. Read-heavy reporting can move to a read replica, so analysts don't slow down the people taking orders. A replica also doubles as a warm standby, which is the core of our PostgreSQL high availability setups.

Symptoms and likely causes

SymptomOften caused by
Slow list viewsUnstored computed fields or missing indexes
Everything slows at the same time each dayA heavy scheduled job
Random slowdowns under loadToo few workers or database connections
Slow reportsPython-side aggregation over large datasets
Workers restartingMemory limits hit by large imports or exports
Gradual slowdown over monthsTable and index bloat from vacuum falling behind

Keep the database healthy

PostgreSQL needs regular vacuuming for four reasons: to reclaim space from updated and deleted rows, to keep planner statistics current, to maintain the visibility map that makes index-only scans fast, and to protect against transaction ID wraparoundSource [4]. The documentation calls autovacuum optional but highly recommended, and for most installations it's enough on its ownSource [4].

Odoo updates rows constantly, so autovacuum has to keep up. Watch table bloat, long-running transactions that block vacuum, and connection counts. Put the database on fast storage, and keep it on a dedicated machine or managed service once the instance is busy. A healthy database solves more Odoo performance problems than any application-level trick.

Caching, carefully

Odoo already caches a lot internally, and adding more caching layers can create subtle bugs where users see stale prices or stock levels. Focus external caching on static assets and public website pages, where content changes rarely and stale data is harmless. For business data, faster queries are almost always a better answer than caches.

If you run the Odoo website for heavy public traffic, a CDN in front of it reduces load dramatically. Just make sure pages that show personalized or transactional content, such as carts and account pages, are excluded from caching.

Plan capacity with headroom

Size workers and database connections from measured load, then leave room for peaks such as month-end closing, seasonal sales, and large imports. Watch memory per worker, because workers that grow without limit will eventually be killed and restarted at the worst moment.

Revisit the numbers after every major change: a new module, an integration, or a jump in users. Performance isn't a project you finish once. It's a habit of measuring and adjusting as the business grows.

Test with realistic load

Before a major launch or seasonal peak, run a load test that mimics real behaviour: users browsing and creating orders, scheduled jobs running, and integrations pushing data, all at the same time. It's far better to find the breaking point in a test than on the busiest day of the year. Tools such as Locust can simulate Odoo users with scripted journeys, and the results show exactly which resource runs out first.

A small dashboard that tracks response times for key pages, worker usage, database query time, and slow-query counts shows the trend long before users complain. Set alerts on the few numbers that matter most and review the trend monthly with whoever plans infrastructure. If you'd rather hand this off, our Odoo performance tuning engagement starts with exactly this measurement.

A performance checklist

  • pg_stat_statements enabled and slow-query logging on
  • The few queries that dominate database time fixed first
  • Workers sized from the rule of thumb, then from measured load
  • Odoo and PostgreSQL on separate machines once the instance is busy
  • Scheduled jobs and integrations separated from user traffic
  • A properly configured proxy, including the /websocket route
  • Autovacuum keeping up, with bloat and long transactions monitored
  • A load test before every major launch or seasonal peak

Frequently asked questions

How many Odoo workers should we run?
Start with Odoo's rule of thumb of (CPU cores × 2) + 1Source [1], check that the server has enough RAM for that many workers plus PostgreSQL, then adjust from measured load. More workers than your CPU and memory can support makes things slower, not faster.
Should Odoo and PostgreSQL run on the same server?
For small instances, yes. Once usage grows, they compete for memory and CPU, and splitting them is usually the simplest performance win available. It also lets you size and back up the database independently.
Will adding a cache make Odoo faster?
For static assets and public website pages, yes. For business data such as prices and stock, caches risk showing stale information. Fixing slow queries is almost always the better investment.
Why does Odoo get slower over time even without new users?
Usually data growth combined with database maintenance falling behind: tables and indexes bloat, statistics go stale, and queries that were fine at 10,000 rows struggle at a million. Healthy autovacuum and a few targeted indexes typically fix itSource [4].

Sources

  1. [1]System configuration (deploy), Odoo 18.0 documentation (opens in a new tab)Odoo S.A.
  2. [2]Resource Consumption, PostgreSQL 18 documentation (opens in a new tab)The PostgreSQL Global Development Group
  3. [3]pg_stat_statements, PostgreSQL 18 documentation (opens in a new tab)The PostgreSQL Global Development Group
  4. [4]Routine Vacuuming, PostgreSQL 18 documentation (opens in a new tab)The PostgreSQL Global Development Group

Written by Anvexis Stack

We build Odoo, AI, web, and cloud systems for growing companies, and we write about the patterns we use. This is engineering guidance, not a product guarantee: check vendor details for your version before you decide. Last reviewed .