1. Rule of thumb:
workers = [ 1 + number of cores * 2]
1 woker = 6 concurrent user
Odoo need crone workers. So we divide above worker into worker + crone worker
The worker become
worker? = worker -1 \\ worker - Max_cron_threads
max_cron_threads? = 1
memory calculations use total workers
limit-memory-soft? = 640 x workers \ \ Bytes (in binary)memory-hard? = 768MB x workers \ \ Bytes (in binary)
Eg: Core=2, RAM = 2
workers = 1+2*2 = 5
Max_cron_threads = 1
Worker = 4
memory calculations use total workers.
limit-memory-soft = 5*640 = 3200 MB = 3355443200 Bytes
memory-hard = 768 x 5 = 3840 MB = 4026531840 Bytes
2. Max_connection rule [used in postgres conf file]
(1 + workers + max_cron_threads) * db_maxconn ? < ? max_connections
For example, if you have following values:
workers = 1 (minimal value to make long polling work)
max_cron_threads = 2 (default)
db_maxconn = 64 (default)
max_connections = 100 (default)
then (1 + 1 + 2) * 64 = 256 > 100, i.e. the condition is not satisfied and such
deployment may face the error described above.