Back to Blog
Engineering
Performance
Scaling
DevOps

Scaling Odoo for High Traffic Events

S
Sarah Chen
DevOps Engineer
December 10, 2025
8 min read

# Introduction

When your Odoo instance needs to handle thousands of concurrent users during peak events like Black Friday, proper scaling becomes critical. This guide walks you through the essential configurations and best practices.

## Understanding Odoo Workers

Odoo uses a multi-process architecture. Each worker process can handle multiple requests concurrently using gevent.

```python
# odoo.conf
workers = 8
max_cron_threads = 2
limit_memory_hard = 2684354560
limit_memory_soft = 2147483648
limit_request = 8192
limit_time_cpu = 600
limit_time_real = 1200
```

### Calculating Optimal Workers

The formula for worker count:
- **CPU-bound**: workers = (CPU cores * 2) + 1
- **I/O-bound**: workers = (CPU cores * 4)

For a 4-core server handling mostly I/O operations, start with 8-12 workers.

## Database Connection Pooling

PostgreSQL connections are expensive. Use pgBouncer to pool connections efficiently.

```bash
# Install pgBouncer
sudo apt-get install pgbouncer

# Configure /etc/pgbouncer/pgbouncer.ini
[databases]
odoo = host=localhost port=5432 dbname=odoo

[pgbouncer]
listen_port = 6432
listen_addr = 127.0.0.1
auth_type = md5
pool_mode = transaction
max_client_conn = 1000
default_pool_size = 25
```

## Load Balancing with Nginx

Distribute traffic across multiple Odoo instances:

```nginx
upstream odoo {
least_conn;
server 127.0.0.1:8069 weight=1 max_fails=3 fail_timeout=30s;
server 127.0.0.1:8070 weight=1 max_fails=3 fail_timeout=30s;
server 127.0.0.1:8071 weight=1 max_fails=3 fail_timeout=30s;
}

server {
listen 80;
server_name yourdomain.com;

location / {
proxy_pass http://odoo;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
```

## Monitoring & Alerts

Set up monitoring to catch issues before they impact users:

- **Prometheus + Grafana** for metrics
- **Sentry** for error tracking
- **UptimeRobot** for availability monitoring

## Conclusion

Scaling Odoo requires a multi-faceted approach: proper worker configuration, database pooling, load balancing, and continuous monitoring. Start with these configurations and adjust based on your specific traffic patterns.

**Pro Tip:** Always load test before the actual event. Tools like Apache JMeter or Locust can simulate thousands of concurrent users.

Share this article

Scaling Odoo for High Traffic Events | Sendan Cloud Blog