Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

15

Difference between built-in multiprocessor-mode and gunicorn

By
Andreas Brueckl
on 2/15/13, 5:03 AM 15,880 views

Does anybody know the differences between the built-in multiprocessor-mode (started with "openerp-server.py --workers X") and gunicorn?

Relevant properties would be:

  • memory limits
  • CPU time limits
  • dynamic control of the number of worker processes
  • ...

The following topic uses gunicorn for a high availability deployment: Link

18

Olivier Dony (odo)

--Olivier Dony (odo)--
2112
| 7 6 7
--Olivier Dony (odo)--

 

Olivier Dony (odo)
On 2/22/13, 6:25 AM

The built-in multiprocess mode is new in v7, and mostly replaces the previous gunicorn-based multiprocess mode of v6.1. It has the same kind of features as v6.1's gunicorn settings, as shown by openerp-server --help:

$ ./openerp-server --help

Usage: openerp-server [options]

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit

  (...)

  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).

This new built-in multi-process HTTP Server (nicknamed MultiCorn - pun on Unicorn intended) makes deployment easier while reusing the same design principles as Gunicorn: a WSGI-compliant HTTP server with pre-forked worker processes.

It adds a few niceties on top of what was already possible with Gunicorn in v6.1, such as:

  • No need to run and manage separately another OpenERP process for executing background OpenERP jobs (ir.cron). MultiCorn spawns a dedicated CronWorker automatically (controlled by --max-cron-threads)
  • The WSGI entry point is now openerp.service.wsgi_server.application (it was openerp.wsgi.application in v6.1), but v7.0 has a new openerp-wsgi.py startup script to make deploying in WSGI containers easier

All the ideas behind the introduction of the multi-process mode in v6.1 still apply.

So no need to run gunicorn in V7.0 ?

Altınkaya Elektronik Cihaz Kutuları imalat Ticaret ltd sti, Ahmet Altinisik
on 2/22/13, 7:22 AM

@Ahmet: You can still run OpenERP 7.0 with Gunicorn if you like, but it's definitely redundant with the built-in --workers option, and you'll have to adapt the wgsi entry point etc. as they changed since v6.1.

Olivier Dony (odo)
on 2/22/13, 7:43 AM

What is the default value for --workers and what is the recommended value for --workers (like 2*core+1), can I also add a line in conf file like workers=4 to define it?

Altınkaya Elektronik Cihaz Kutuları imalat Ticaret ltd sti, Ahmet Altinisik
on 2/22/13, 8:42 AM

I'd definitly love an answer to Ahmet Altınışık questions actually. Anyone ?

Henri-Maxime Ducoulombier
on 11/27/13, 4:12 PM

Yes, I'd like some clues as to the syntax of these options as well. If I just put a couple of lines with worker=8 and limit-time-cpu=300 they appear to have no effect

Billy Watt
on 11/28/13, 12:54 PM

The recommended --workers value is 2*cores+1, as with gunicorn. You can put it in the config file too, e.g workers=5, haven't you tried that? The same goes with the various --limit-* options, e.g. limit_cpu_time=1200 to limit requests to 20 minutes. The limits apply only when workers > 0

Olivier Dony (odo)
on 11/28/13, 1:24 PM

I see where my problem was. Where it says limit-time-cpu it actually means limit_time_cpu. Surprised I didn't work that one out myself....... Thanks for your help

Billy Watt
on 11/29/13, 5:36 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/15/13, 5:03 AM
Seen: 15880 times
Last updated: 8/16/16, 3:53 AM