Skip to Content
Menu
This question has been flagged

Hello, i face the following error

2022-05-30 15:00:26,943 1940 WARNING ? odoo.service.server: Server memory limit (4934283264) reached.
2022-05-30 15:00:26,954 1940 INFO ? odoo.service.server: Dumping stacktrace of limit exceeding threads before reloading
2022-05-30 15:00:26,997 1940 INFO ? odoo.tools.misc:
# Thread: 140592199739200)> (db:n/a) (uid:n/a) (url:n/a)
File: "/opt/odoo/odoo14/odoo-bin", line 8, in 
  odoo.cli.main()
File: "/opt/odoo/odoo14/odoo/cli/command.py", line 61, in main
  o.run(args)
File: "/opt/odoo/odoo14/odoo/cli/server.py", line 178, in run
  main(args)
File: "/opt/odoo/odoo14/odoo/cli/server.py", line 172, in main
  rc = odoo.service.server.start(preload=preload, stop=stop)
File: "/opt/odoo/odoo14/odoo/service/server.py", line 1298, in start
  rc = server.run(preload, stop)
File: "/opt/odoo/odoo14/odoo/service/server.py", line 546, in run
  dumpstacks(thread_idents=[thread.ident for thread in self.limits_reached_threads])
File: "/opt/odoo/odoo14/odoo/tools/misc.py", line 957, in dumpstacks
  for line in extract_stack(stack):
2022-05-30 15:00:27,007 1940 INFO ? odoo.service.server: Initiating server reload

and i tried several solutions like increase

limit_request = 8192

limit_time_cpu = 600

limit_time_real = 1200

max_cron_threads = 1

limit_memory_hard = 536870637100

limit_memory_soft = 483183573400

but still facing same issue as error log...


Avatar
Discard
Best Answer

This issue raise because the memory > limit_memory_soft. I think your server Memory is 4GB so you got this error.


You can calculate the  limit_memory_soft and  limit_memory_hard depend on workers and workers depend on the concurrent users.


For Example:


Server with 4 CPU Core, 8G RAM

60 concurrent users
60 users / 6 = 10 workers = (core * 2) + 1 = (4*2)+1(Cron Worker) so (4 * 2) + 1 = 9
RAM = 9 * ((0.8*150) + (0.2*1024)) ~= 3Go RAM for Odoo

limit_memory_hard = 768 * 9  (Workers) * 1024 * 1024 = 7247757312

limit_memory_soft = 640 * 9 (Workers)* 1024 * 1024 = 6039797760

max_cron_threads = 1

workers = 8

Note: You need to restart Odoo after any change in config file.


Multiprocessing options:
    --workers=WORKERS   Specify the number of workers, 0 disable prefork mode.
    --limit-memory-soft=LIMIT_MEMORY_SOFT
                        Maximum allowed virtual memory per worker, when
                        reached the worker be reset after the current request
                        (default 671088640 aka 640MB).
    --limit-memory-hard=LIMIT_MEMORY_HARD
                        Maximum allowed virtual memory per worker, when
                        reached, any memory allocation will fail (default
                        805306368 aka 768MB).
    --limit-time-cpu=LIMIT_TIME_CPU
                        Maximum allowed CPU time per request (default 60).
    --limit-time-real=LIMIT_TIME_REAL
                        Maximum allowed Real time per request (default 120).
    --limit-request=LIMIT_REQUEST
                        Maximum number of request to be processed per worker
                        (default 8192).




Avatar
Discard
Author

i did what you said over

limit_memory_hard = 70852608
limit_memory_soft = 4026531840
workers = 6

as we i use 4vCPUs & 16GB RAM
but i got same issue but with different issues over odoo.log

The 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.
For example, if you have a VPS with 4 CPU cores and 16 GB of RAM, the number of workers should be 9 (CPU cores * 2 + 1), total limit-memory-soft value will be 640MB x 9 = 5760 MB , and total limit-memory-hard 768MB x 17 = 6912 MB,
so Odoo will use maximum 5.4 GB of RAM.

You server is 4vCPUs so try the below:

limit_memory_hard = 7247757312
limit_memory_soft = 6039797760
max_cron_threads = 1
workers = 8

Author

Big thanks, till now the crash didn't happened

Author

after i make this i noticed some attachment files corrupted from outside the server but inside the server its working fine. can you advice?

Related Posts Replies Views Activity
1
Jun 23
4069
1
Mar 23
1417
0
Oct 15
3803
2
Jul 24
6073
0
Jan 24
489