This most likely isn't the easiest answer but I just got done setting up a test environment that works using Nginx and uWSGI over Pyramid and once you've got it setup you can extend it very very easily, for instance if your /ws is pulling too many resources, it's trivial with Nginx+uWSGI to relocate /ws to different hardware. My background is Pyramid and my uWSGI experience has only been with testing but in my reading it seems a solution that should work well. The bottle instructions were the result of a quick google search.
The Concept:
The concept is to take your app, ie your
app = make_wsgi_app.from_config(config) before the
app.serve_forever() call and instead use uwsgi to 'serve' your app to a socket
app1.sock. There are many ways to configure uWSGI. The uWSGI site has documentation for more ways to configure uWSGI to talk to your app. Nginx comes with configuration to use uWSGI sockets natively at least in the current version. You just pass the
uwsgi_pass unix:///tmp/app1.sock; path to the sites configuration along with the params. Do this twice in the same site conf file, once for
location / { and once for
location /ws { pointing to their respective app sock files and you should be good to go.
The concept of serving an app to a socket as file was new to me when I was setting up the testing environment, I hope this helps.
What to get:
nginx
uWSGI
HowTo:
Pull the nginx and uwsgi setup information out of this tutorial and cater it to your app, here for bottle specific setup or head over to the uwsgi site and checkout their configuration instructions. The documentation for each specific tech is pretty good so even with the lack of combined examples it wasn't difficult to get them working together. With both Nginx and uWSGI there are a huge number of configuration settings so be sure to take a look at those as well.