Quick Answer
For enterprise-scale Odoo with 200+ concurrent users and 500GB+ databases, standard tuning isn't enough. You need advanced engineering: Redis for session caching, fine-tuned PostgreSQL parameters (shared_buffers, work_mem, effective_cache_size), Varnish for static asset acceleration, Odoo's built-in profiler for bottleneck detection, and automated database maintenance scripts.
Introduction: From "Fast Enough" to "Instant"
Basic tuning—like adjusting workers or enabling multiprocessing—is the first step. But what happens when your database grows to 500GB? Or when you have 200 concurrent users hitting the system?
At that scale, "standard" configuration isn't enough. You need advanced engineering.
For Odoo administrators, MSPs, and DevOps leads, this guide dives into the "deep end" of performance optimization. We cover caching layers, database parameter tuning, and profiling strategies to squeeze every millisecond of latency out of your instance.
Tip #1: Implement a Redis Cache Layer
Why: Odoo's default file-based session storage is too slow for high-concurrency environments.
By default, Odoo stores sessions on the file system. In a multi-server or high-traffic setup, this creates "IO Wait" (disk lag). Redis moves this into RAM, making session validation instant.
The Advanced Config:
Don't just install Redis; configure Odoo to use it properly.
Step 1: Install Redis
Install Command:
sudo apt-get install redis-server
Step 2: Edit odoo.conf - Add the session interface parameters
odoo.conf Configuration:
[options]
enable_redis = True
redis_host = localhost
redis_port = 6379
redis_db_index = 1
⚠️ Note: Odoo Enterprise or specific community modules like redis_session_store are often required to enable full Redis support depending on your version.
Tip #2: Fine-Tune PostgreSQL Parameters (The "Magic 3")
Why: Default Postgres settings use <5% of your available RAM.
PGTune is great for a baseline, but for Odoo, you need to be aggressive with three specific parameters in postgresql.conf.
1. shared_buffers (The Cache)
Recommendation:
Example (32GB Server):
Reasoning:
2. work_mem (The Sort Speed)
Recommendation:
⚠️ Warning:
Reasoning:
3. effective_cache_size
Recommendation:
Reasoning:
💡 Pro Tip: Database tuning is risky. Braincuber's DBAs can optimize your PostgreSQL safely with a tuning session.
Tip #3: Configure Varnish for Static Asset Caching
Why: Nginx is good, but Varnish is a dedicated HTTP accelerator.
Odoo serves thousands of static assets (JS, CSS, Images). Varnish sits in front of Odoo and serves these from memory, meaning the request never even touches your Odoo server.
The Strategy:
✓ Cache:
Images, CSS, JS bundles
✗ Pass (Don't Cache):
/web, /longpolling, and any authenticated JSON-RPC calls
Key VCL Snippet:
sub vcl_recv {
if (req.url ~ "\.(css|js|png|jpg|jpeg|gif|svg|ico|woff|woff2)$") {
unset req.http.cookie;
return (hash);
}
}
By stripping cookies from static assets, you force Varnish to treat them as public and cacheable.
Tip #4: Use the Built-in Odoo Profiler (Odoo 16+)
Why: Guessing which code is slow is expensive. Measuring it is free.
Odoo now has a built-in profiler that generates Flamegraphs. This visualizes exactly which function is eating up your CPU time.
How to Use It:
Step 1: Enable Developer Mode
Step 2: Go to the slow page/action
Step 3: Click the "Bug" icon → Start Profiling
Step 4: Perform the slow action
Step 5: Stop Profiling and download the JSON/HTML report
What to Look For:
"N+1 Queries": A function calling the database inside a loop
"Heavy Compute Fields": A calculated field that is re-computing thousands of times unnecessarily
💡 Pro Tip: Found a slow function but can't fix it? Braincuber's code performance audit can identify and resolve bottlenecks.
Tip #5: Automated Maintenance (Vacuum & Reindex)
Why: "Dead Tuples" slow down every search.
Odoo deletes data frequently (e.g., transient wizards, cart sessions). Postgres marks this space as "available" but doesn't return it to the OS. This causes "Bloat."
The Maintenance Script:
Create a cron job that runs a custom vacuum script weekly (Sunday 2 AM).
maintenance.sh:
#!/bin/bash
DB_NAME="my_odoo_db"
vacuumdb -d $DB_NAME -z -f -v
reindexdb -d $DB_NAME
Vacuum Full (-f)
Reclaims disk space
⚠️ Note: Locks tables!
Reindex
Rebuilds b-tree indexes to speed up searches
Performance Optimization Summary
| Optimization | Impact | Complexity | Best For |
|---|---|---|---|
| Redis Session Cache | 🔥 High | Medium | Multi-server setups |
| PostgreSQL "Magic 3" | 🔥 High | Advanced | Large databases |
| Varnish HTTP Cache | ⚡ Medium-High | Advanced | High traffic sites |
| Odoo Profiler | ⚡ Variable | Medium | Custom code issues |
| Automated Maintenance | ⚡ Medium | Easy | All installations |
Frequently Asked Questions
Does Odoo work better with Nginx or Apache?
Nginx is the industry standard for Odoo. It handles high concurrency better than Apache and is easier to configure as a reverse proxy for WebSocket (Longpolling) traffic.
What is the ideal server size for 100 users?
For 100 concurrent users, we recommend:
- App Server: 8 CPU Cores, 16GB RAM
- DB Server: 4 CPU Cores, 16GB RAM
- Separation: Keeping App and DB on separate servers is critical at this scale
How do I reduce the size of the Odoo filestore?
You cannot safely delete files manually. Use the "Attachments" view in Odoo to identify large files. Alternatively, move your filestore to S3 Object Storage using a third-party module to offload the disk I/O pressure.
When should I use Varnish vs just Nginx caching?
Use Varnish when you have high traffic (1000+ requests/minute) and need granular cache control with VCL. Nginx caching is simpler but less flexible. For most enterprise Odoo deployments, Varnish provides better performance for static assets.
How do I identify N+1 query problems in Odoo?
Use the Odoo 16+ built-in profiler with Flamegraphs. Look for functions that make repeated database calls in loops. Common culprits include computed fields without proper caching and report generation without prefetching related records.
Conclusion: Speed is Engineering, Not Magic
Achieving a sub-second response time in Odoo requires a holistic approach: caching at the edge (Varnish), tuning the engine (Postgres), and optimizing the code (Profiling).
Ready to Turn Your Odoo into a Ferrari?
Don't guess with your infrastructure. Let Braincuber's DevOps engineers architect a high-performance environment for you.
Book a Performance Architecture Review
Our DevOps experts will analyze your infrastructure, identify bottlenecks, and design a high-performance architecture tailored to your scale.
Expert analysis • Custom recommendations • Performance guarantee
