Skip to content

Server Tuning

When of env update --so runs, Odoofly recalculates optimal Odoo worker and memory settings based on the server's specs and the estimated concurrent users from project.yml.

Workers Calculation

# Base: 1 worker per 6 concurrent users, minimum 2
workers = max((users // 6) + 1, 2)

# Cap: available CPU cores + 3
max_workers = (2 + cpu_count()) + 1
workers = min(workers, max_workers)

Memory Limits

# Soft limit: 75% of total RAM divided by workers
limit_memory_soft = int((total_ram * 0.75) / workers)

# Hard limit: 95% of total RAM divided by workers
limit_memory_hard = int((total_ram * 0.95) / workers)

This ensures every Odoo instance is optimally tuned for its host without manual intervention.

Manual Tuning

Use of env conf to override the calculated values:

# Set custom worker/memory
of env conf main --users 10 --ram 4

# Recalculate from server specs
of env conf main --auto-ram

# Apply changes and restart
of env conf main --db-name mydb --restart