Skip to content

Commit

Permalink
use gevent workers instead of gevent-websocket
Browse files Browse the repository at this point in the history
  • Loading branch information
nategraf committed Feb 19, 2024
1 parent 00f62f6 commit f9a8edc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions gunicorn_config.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import multiprocessing
import os
import base64

# http://docs.gunicorn.org/en/stable/settings.html
# https://github.com/benoitc/gunicorn/blob/master/examples/example_config.py

bind='0.0.0.0:8000'

# Worker settings
worker_class=os.environ.get('WORKER_CLASS', 'geventwebsocket.gunicorn.workers.GeventWebSocketWorker')
worker_class=os.environ.get('WORKER_CLASS', 'gevent')
worker=int(os.environ.get('WORKERS', 2*multiprocessing.cpu_count()))

# Logging settings
Expand All @@ -17,7 +16,7 @@
accesslog=os.environ.get('ACCESS_LOG', '-')
errorlog=os.environ.get('ERROR_LOG', '-')

if not os.environ.get('USE_RELOAD') or os.environ.get('USE_RELOAD').lower() == 'true':
if os.environ.get('USE_RELOAD', "true").lower() == 'true':
# Reload on code changes. Useful for development
reload=True
# poll consumes more resources than inotify, but is more compatible
Expand All @@ -26,5 +25,5 @@
# TLS / SSL
# Check out Let's Encrypt for free certificates https://letsencrypt.org/
if os.environ.get('TLS_KEY') and os.environ.get('TLS_CERT'):
keyfile=os.path.join(os.environ.get('TLS_KEY'))
certfile=os.path.join(os.environ.get('TLS_CERT'))
keyfile=os.environ.get('TLS_KEY')
certfile=os.environ.get('TLS_CERT')

0 comments on commit f9a8edc

Please sign in to comment.