#updatedb\r\n#locate openerp-server\r\n\r\n\/usr\/bin\/openerp-server<\/pre>\nRun the following command:<\/p>\n
#\/usr\/bin\/openerp-server --help<\/pre>\nThe output of this command should be like this:<\/p>\n
Usage: openerp-server [options]\r\n\r\nOptions:\r\n --version show program's version number and exit\r\n\r\n (...)\r\n\r\n Multiprocessing options:\r\n --workers=WORKERS Specify the number of workers, 0 disable prefork mode.\r\n --limit-memory-soft=LIMIT_MEMORY_SOFT\r\n Maximum allowed virtual memory per worker, when\r\n reached the worker be reset after the current request\r\n (default 671088640 aka 640MB).\r\n --limit-memory-hard=LIMIT_MEMORY_HARD\r\n Maximum allowed virtual memory per worker, when\r\n reached, any memory allocation will fail (default\r\n 805306368 aka 768MB).\r\n --limit-time-cpu=LIMIT_TIME_CPU\r\n Maximum allowed CPU time per request (default 60).\r\n --limit-time-real=LIMIT_TIME_REAL\r\n Maximum allowed Real time per request (default 120).\r\n --limit-request=LIMIT_REQUEST\r\n Maximum number of request to be processed per worker\r\n (default 8192).<\/pre>\nThe number of workers should be equal to a number of CPU cores allocated to the VPS, or if you want to leave some CPU cores exclusively for the PostgreSQL database, cron jobs or other applications installed on the same VPS where the Odoo instance is installed and running, set the number of workers to a lower value than CPU cores available on the VPS to avoid resources exhaustion.
\nThe limit-memory-soft and limit-memory-hard are self-explanatory, and you should leave them to the default value or modify them depending on the RAM available on the actual VPS.
\nFor example, if you have a VPS with 8 CPU cores and 16 GB of RAM, the number of workers should be 17 (CPU cores * 2 + 1), total limit-memory-soft value will be 640 x 17 = 10880 MB , and total limit-memory-hard 768MB x 17 = 13056 MB, so Odoo will use maximum 12.75 GB of RAM.<\/p>\n
For example, on a VPS with 16 GB of RAM and 8 CPU cores, edit the Odoo configuration file (e.g. \/etc\/odoo-server.conf), and add the following lines to it:<\/p>\n
vi \/etc\/odoo-server.conf<\/pre>\nworkers = 17\r\n\r\nlimit_memory_hard = 13690208256\r\n\r\nlimit_memory_soft = 11408506880\r\n\r\nlimit_request = 8192\r\n\r\nlimit_time_cpu = 60\r\n\r\nlimit_time_real = 120\r\n\r\nmax_cron_threads = 2<\/pre>\nDo not forget to restart Odoo for the changes to take effect.<\/p>\n