worker_class = "sync"

# Set timeout to the same value as the default one from Amazon ELB (60 secs).
# It should be 60 seconds, but gunicorn halves the configured value,
# see https://github.com/benoitc/gunicorn/issues/829
timeout = 120

# Recycle worker processes after 100k requests to prevent memory leaks
# from effecting us
max_requests = 100000

# Avoid too much output on the console
loglevel = "warning"


def post_worker_init(worker):
    from random import randint

    # Use 10% jitter, to prevent all workers from restarting at once,
    # as they get an almost equal number of requests
    jitter = randint(0, max_requests // 10)
    worker.max_requests += jitter

    # Actually initialize the application
    worker.wsgi(None, None)

worker_class = "sync"

# Set timeout to the same value as the default one from Amazon ELB (60 secs).
timeout = 60

# Recycle worker processes after 100k requests to prevent memory leaks
# from effecting us
max_requests = 100000

# Avoid too much output on the console
loglevel = "warning"


def post_worker_init(worker):
    from random import randint

    # Use 10% jitter, to prevent all workers from restarting at once,
    # as they get an almost equal number of requests
    jitter = randint(0, max_requests // 10)
    worker.max_requests += jitter

    # Actually initialize the application
    worker.wsgi(None, None)

Update gunicorn timeout after gunicorn issue was answered.
Update gunicorn timeout after gunicorn issue was answered.

  worker_class = "sync"
  
  # Set timeout to the same value as the default one from Amazon ELB (60 secs).
- # It should be 60 seconds, but gunicorn halves the configured value,
- # see https://github.com/benoitc/gunicorn/issues/829
- timeout = 120
+ timeout = 60
  
  # Recycle worker processes after 100k requests to prevent memory leaks
  # from effecting us
  max_requests = 100000
  
  # Avoid too much output on the console
  loglevel = "warning"
  
  
  def post_worker_init(worker):
      from random import randint
  
      # Use 10% jitter, to prevent all workers from restarting at once,
      # as they get an almost equal number of requests
      jitter = randint(0, max_requests // 10)
      worker.max_requests += jitter
  
      # Actually initialize the application
      worker.wsgi(None, None)
  
Update gunicorn timeout after gunicorn issue was answered.
## Code Before:
worker_class = "sync"

# Set timeout to the same value as the default one from Amazon ELB (60 secs).
# It should be 60 seconds, but gunicorn halves the configured value,
# see https://github.com/benoitc/gunicorn/issues/829
timeout = 120

# Recycle worker processes after 100k requests to prevent memory leaks
# from effecting us
max_requests = 100000

# Avoid too much output on the console
loglevel = "warning"


def post_worker_init(worker):
    from random import randint

    # Use 10% jitter, to prevent all workers from restarting at once,
    # as they get an almost equal number of requests
    jitter = randint(0, max_requests // 10)
    worker.max_requests += jitter

    # Actually initialize the application
    worker.wsgi(None, None)

## Instruction:
Update gunicorn timeout after gunicorn issue was answered.
## Code After:
worker_class = "sync"

# Set timeout to the same value as the default one from Amazon ELB (60 secs).
timeout = 60

# Recycle worker processes after 100k requests to prevent memory leaks
# from effecting us
max_requests = 100000

# Avoid too much output on the console
loglevel = "warning"


def post_worker_init(worker):
    from random import randint

    # Use 10% jitter, to prevent all workers from restarting at once,
    # as they get an almost equal number of requests
    jitter = randint(0, max_requests // 10)
    worker.max_requests += jitter

    # Actually initialize the application
    worker.wsgi(None, None)
