Files
notifications-api/gunicorn_config.py
Athanasios Voutsadakis 8f1f546f69 Increase pool size to 15 permanent connections
At the same time, decrease the number of workers from 5 to 4.

Effect on max db connections will be the same - although with a higher
"resting" number of connections.

Before:
12 (instances) * 5 (workers) * 20 (10 permanent + 10 overflow) = 1200

After:
12 (instances) * 4 (workers) * 25 (15 permanent + 10 overflow) = 1200
2018-03-29 14:57:19 +01:00

28 lines
659 B
Python

import os
import sys
import traceback
workers = 4
worker_class = "eventlet"
worker_connections = 256
errorlog = "/home/vcap/logs/gunicorn_error.log"
bind = "0.0.0.0:{}".format(os.getenv("PORT"))
def on_starting(server):
server.log.info("Starting Notifications API")
def worker_abort(worker):
worker.log.info("worker received ABORT {}".format(worker.pid))
for threadId, stack in sys._current_frames().items():
worker.log.error(''.join(traceback.format_stack(stack)))
def on_exit(server):
server.log.info("Stopping Notifications API")
def worker_int(worker):
worker.log.info("worker: received SIGINT {}".format(worker.pid))