Skip to content

Instantly share code, notes, and snippets.

Avatar

Omed Habib omedhabib

View GitHub Profile
View uWSGI.sh
#!/usr/bin/env bash
PROCESSOR_COUNT=$(nproc)
THREAD_COUNT=2
uwsgi --http :9808 --plugin python2 --wsgi-file app.py --processes "$PROCESSOR_COUNT" --threads "$THREAD_COUNT" --disable-logging
View mod_WSGI-express.sh
#!/usr/bin/env bash
PROCESSOR_COUNT=$(nproc)
THREAD_COUNT=2
USER=www-data
GROUP=www-data
mod_wsgi-express start-server app.py --port 9808 --processes "$PROCESSOR_COUNT" --threads "$THREAD_COUNT" --user "$USER" --group "$GROUP"
View Meinheld.wsgi
import meinheld
from app import application
meinheld.listen(("0.0.0.0", 9808))
meinheld.run(application)
View Gunicorn.sh
#!/usr/bin/env bash
PROCESSOR_COUNT=$(nproc)
GUNICORN_WORKER_COUNT=$(( PROCESSOR_COUNT * 2 + 1 ))
gunicorn -w ${GUNICORN_WORKER_COUNT} -b 0.0.0.0:9808 app:application
View CherryPy.wsgi
import socket
from cherrypy import wsgiserver
from app import application
server = wsgiserver.CherryPyWSGIServer(
bind_addr=('0.0.0.0', 9808),
wsgi_app=application,
request_queue_size=500,
server_name=socket.gethostname()
)
View Bbjoern.wsgi
import bjoern
from app import application
bjoern.run(
wsgi_app=application,
host='0.0.0.0',
port=9808,
reuse_port=True
)
You can’t perform that action at this time.