Created
May 13, 2016 16:03
-
-
Save 72squared/366c3f2afdba6fc5da1fe3d5b86e11d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download pypy | |
wget "https://bitbucket.org/pypy/pypy/downloads/pypy-5.1.1-linux64.tar.bz2" -O - | tar -xj | |
# create virtual env with pypy | |
virtualenv -p pypy-5.1.1-linux64/bin/pypy .venv | |
# activate virtual environment | |
source .venv/bin/activate | |
# install uwsgi and gevent | |
pip install uwsgi gevent | |
# install sample app (restful file system) | |
pip install -e git://github.com/happybits/napfs@v0.0.3#egg=napfs | |
# create uwsgi config file - uses gevent | |
cat << EOF > uwsgi.ini | |
[uwsgi] | |
http = 127.0.0.1:8222 | |
pypy-wsgi = main:app | |
master = true | |
vacuum = true | |
enable-threads = true | |
die-on-term = true | |
uid = nobody | |
gid = nogroup | |
max-requests = 500000 | |
no-orphans = true | |
disable-logging = true | |
reload-mercy = 5 | |
processes = 2 | |
gevent = 1000 | |
gevent-monkey-patch = true | |
EOF | |
# sample app setup | |
cat << EOF > main.py | |
import napfs | |
app = napfs.create_app() | |
EOF | |
# kick off uwsgi in foreground | |
uwsgi --ini ./uwsgi.ini | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was tested in vagrant
https://cloud-images.ubuntu.com/vagrant/wily/current/wily-server-cloudimg-amd64-vagrant-disk1.box