Gunicorn on OpenERP 6.1


Gunicorn ‘Green Unicorn’ is a Python WSGI HTTP Server for UNIX. It’s a pre-fork worker model ported from Ruby’s Unicorn project. The Gunicorn server is broadly compatible with various web frameworks, simply implemented, light on server resources, and fairly speedy.

How you can use Gunicorn to boost your OpenERP server performance. Down we see how we can configure to achieve the massive performance improvement on OpenERP Server.

As of 6.1 OpenERP server has the inbuilt support for WSGI and you just need to specify the configuration parameters

you will find a sample configuration file for OpenERP in this path of OpenERP server source code “6.1/server/”

for more Details you can visit

To run the OpenERP server via Gunicorn, change the appropriate settings below, in order to provide the parameters that would normally be passed in the command-line,
(at least `bind` and `conf[‘addons_path’]`), then execute:

 $ gunicorn openerp:wsgi.core.application -c

or if you want to run it behind a reverse proxy, add the line import openerp.wsgi.proxied  in this file and execute:

 $ gunicorn openerp:wsgi.proxied.application -c

import openerp

Standard OpenERP XML-RPC port is 8069

bind = ‘’

pidfile = ‘’

Gunicorn recommends 2-4 x number_of_cpu_cores, but you’ll want to vary this a bit to find the best for your particular work load.

workers = 4

Some application-wide initialization is needed.
on_starting = openerp.wsgi.core.on_starting
pre_request = openerp.wsgi.core.pre_request
post_request = openerp.wsgi.core.post_request

openerp request-response cycle can be quite long for big reports for example
timeout = 240

max_requests = 2000

Equivalent of –load command-line option

openerp.conf.server_wide_modules = [‘web’]

conf =

Path to the OpenERP Addons repository (comma-separated for multiple locations)

conf[‘addons_path’] = ‘/home/openerp/addons/trunk,/home/openerp/web/trunk/addons’

Optional database config if not using local socket
conf[‘db_name’] = ‘DBNAME’
conf[‘db_host’] = ‘localhost’
conf[‘db_user’] = ‘DB USER’
conf[‘db_port’] = DB PORT
conf[‘db_password’] = ‘YOUR DB PASSWORD’

OpenERP Log Level


conf[‘log_level’] = 20

If –static-http-enable is used, path for the static web directory
conf[‘static_http_document_root’] = ‘/var/www’

Just make this changes and get the massive performance speed on OpenERP 6.1




2 thoughts on “Gunicorn on OpenERP 6.1

  1. hello i am a codeadict like you :), i am trying to configure gunicorn with openerp 6.1 and i get the following error msg:
    “Worker failed to boot”
    I have already set up a reverse proxy with nginx and need some help to configure gunicorn with nginx.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s