Odoo Performance Optimization: Speed Up Your Server
How to optimize Odoo performance in 2026 β worker config, database indexing, Redis caching, and Nginx tuning to cut response times by 70% or more.
How to tell if your Odoo server is slow
"Odoo is slow" is subjective. Measure first:
Response time benchmarks:
- Homepage load: < 2 seconds (logged-in user, no cache)
- Sales order creation: < 3 seconds
- Invoice PDF generation: < 5 seconds
- Product search (500 products): < 1 second
- Report generation (100-line table): < 10 seconds
If your Odoo exceeds these times consistently, performance tuning is needed.
Built-in profiling:
Enable Odoo's built-in profiler in odoo.conf:
limit_time_real = 300
limit_time_cpu = 180
log_level = debug
Slow queries (> 5 seconds) will be logged to /var/log/odoo/odoo-server.log with full SQL and stack trace.
1. Tune worker processes
Odoo uses multi-process workers to handle concurrent requests. Too few workers = slow response under load. Too many = RAM exhaustion and context-switching overhead.
Worker formula (for production):
workers = (CPU_cores * 2) + 1
For a 4-core server: workers = 9
In odoo.conf:
workers = 9
max_cron_threads = 2
limit_memory_hard = 2684354560 # 2.5 GB per worker
limit_memory_soft = 2147483648 # 2 GB
Restart Odoo:
sudo systemctl restart odoo
Monitor RAM usage:
htop
Each worker can consume 1-2 GB under load. For 9 workers, you need at least 16 GB RAM. If workers frequently hit the memory limit and restart, reduce the worker count or upgrade RAM.
2. Enable PostgreSQL query caching
PostgreSQL's shared_buffers cache frequently accessed data in RAM, reducing disk I/O.
Edit /etc/postgresql/*/main/postgresql.conf:
shared_buffers = 4GB # 25% of total RAM
effective_cache_size = 12GB # 75% of total RAM
work_mem = 64MB
maintenance_work_mem = 512MB
Restart PostgreSQL:
sudo systemctl restart postgresql
Verify settings:
sudo -u postgres psql
SHOW shared_buffers;
SHOW effective_cache_size;
If queries are still slow, enable query statistics:
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
Then query the slowest 10:
SELECT query, calls, total_time, mean_time
FROM pg_stat_statements
ORDER BY total_time DESC
LIMIT 10;
3. Add database indexes
Missing indexes are the #1 cause of slow Odoo queries. A table scan on 100,000 records takes seconds; an indexed lookup takes milliseconds.
Identify missing indexes:
Odoo logs slow queries with EXPLAIN output when log_level = debug. Look for "Seq Scan" (sequential scan) in the logs β these are table scans that need an index.
Common indexes to add:
CREATE INDEX idx_sale_order_partner ON sale_order(partner_id);
CREATE INDEX idx_account_move_date ON account_move(date);
CREATE INDEX idx_stock_move_product ON stock_move(product_id);
CREATE INDEX idx_res_partner_name ON res_partner(name);
After adding indexes, analyze tables:
ANALYZE;
This updates PostgreSQL's query planner statistics so it uses the new indexes.
4. Enable HTTP caching for static assets
Odoo serves CSS, JS, and images on every request. Without caching, browsers re-download these files unnecessarily.
Nginx caching configuration:
location ~* \.(css|js|png|jpg|jpeg|gif|ico|woff|woff2|ttf)$ {
expires 30d;
add_header Cache-Control "public, immutable";
proxy_pass http://127.0.0.1:8069;
}
Reload Nginx:
sudo systemctl reload nginx
Test caching:
curl -I https://odoo.yourcompany.com/web/static/src/css/bootstrap.min.css
You should see:
Cache-Control: public, immutable
Expires: [30 days from now]
Browsers will cache these files for 30 days, reducing page load time from 3 seconds to under 1 second.
5. Use a CDN for static assets
If your users are geographically distributed, serving assets from a single server adds latency. A CDN (Content Delivery Network) caches assets at edge locations worldwide.
Cloudflare (free tier):
1. Sign up at cloudflare.com
2. Add your domain and update nameservers
3. Enable "Cache Level: Standard" in Cloudflare dashboard
4. Set Browser Cache TTL to "1 month"
Cloudflare automatically caches /web/static/* and serves it from the nearest edge location. Users in Europe get assets from European servers; users in Asia get them from Asian servers.
6. Archive old records
Large tables slow down queries even with indexes. A sale_order table with 500,000 rows takes longer to search than one with 50,000.
Identify large tables:
sudo -u postgres psql odoo_production
SELECT schemaname, tablename, pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) AS size
FROM pg_tables
WHERE schemaname NOT IN ('pg_catalog', 'information_schema')
ORDER BY pg_total_relation_size(schemaname||'.'||tablename) DESC
LIMIT 10;
Archive old data:
For records older than 2 years that you rarely access:
- Export them to a separate "archive" database
- Delete from production
- Keep the archive database offline except when needed for historical lookups
This keeps the production database small and fast.
7. Schedule heavy operations off-peak
Reports, data imports, and month-end closing operations consume CPU and lock database tables. Running them during business hours degrades performance for everyone.
Move heavy cron jobs to night:
In Odoo, go to Settings β Technical β Automation β Scheduled Actions
Set "Next Execution Date" to 2:00 AM for:
- Inventory valuation
- Aged receivables report
- Data cleanup (expired sessions, old logs)
Database maintenance:
Schedule VACUUM and ANALYZE in a cron job at 3 AM:
0 3 * * * /usr/bin/sudo -u postgres psql odoo_production -c "VACUUM ANALYZE;"
This reclaims disk space and updates query planner statistics without user impact.
Automate your Odoo server management today
Connect your Odoo server in 5 minutes. Free to start.
Start free β no credit cardRelated Articles
Odoo Security Best Practices: Hardening Your Server in 2026
Odoo security best practices 2026 β firewall config, SSH hardening, database encryption, rate limiting, and preventing the most common attack vectors.
Odoo Server Monitoring: Prevent Downtime Before It Happens
Complete guide to Odoo server monitoring β track disk, memory, services, and database performance with real-time alerts that prevent downtime.
Odoo vs Odoo.sh: Which Should You Choose in 2026?
Self-hosted Odoo vs Odoo.sh comparison 2026 β pricing breakdown, performance benchmarks, control trade-offs, and which hosting saves you more money.