Skip to content

Commit

Permalink
Parameterizing the number of gunicorn workers
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Jan 15, 2016
1 parent 976b777 commit d9e4c75
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions panoramix/bin/panoramix
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ manager.add_command('db', MigrateCommand)
@manager.option(
'-p', '--port', default=config.get("PANORAMIX_WEBSERVER_PORT"),
help="Specify the port on which to run the web server")
@manager.option(
'-w', '--workers', default=config.get("PANORAMIX_WORKERS", 16),
help="Number of gunicorn web server workers to fire up")
@manager.option(
'-t', '--timeout', default=config.get("PANORAMIX_WEBSERVER_TIMEOUT"),
help="Specify the timeout (seconds) for the gunicorn web server")
def runserver(debug, port, timeout):
def runserver(debug, port, timeout, workers):
"""Starts a Panoramix web server"""
debug = debug or config.get("DEBUG")
if debug:
Expand All @@ -34,7 +37,7 @@ def runserver(debug, port, timeout):
else:
cmd = (
"gunicorn "
"-w 8 "
"-w {workers} "
"--timeout {timeout} "
"-b 0.0.0.0:{port} "
"panoramix:app").format(**locals())
Expand Down

0 comments on commit d9e4c75

Please sign in to comment.