Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 1.03 KB

File metadata and controls

34 lines (28 loc) · 1.03 KB

Gunicorn

gUnicorn with gevent

Due to the way gevent changes the default behaviour of python-native modules such as multiprocessing we do not offer support for gevent. (read more)

Installation/Setup

  1. Install aikido_zen package with pip :
pip install aikido_zen
  1. Use the following template for your gunicorn_config.py file :
import aikido_zen.decorators.gunicorn as aik

@aik.post_fork
def post_fork(server, worker):
    # If you already have a config file, replace pass with your own code.
    pass

And make sure to include this config when starting gunicorn by adding the -c gunicorn_config.py flag.

gunicorn -c gunicorn_config.py --workers ...
  1. Setting your environment variables : Make sure to set your token in order to communicate with Aikido's servers
AIKIDO_TOKEN="AIK_RUNTIME_YOUR_TOKEN_HERE"
  • Enabling extra debugging (optional): AIKIDO_DEBUG=1
  • Enabling blocking using an env variable (optional): AIKIDO_BLOCK=1