2

In the past, I've written websites in two languages. PHP for smaller sites and Python for larger sites. With this setup, I would run multiple Paster instances to serve each site on a different port and then use nginx to proxy to Paster. This worked fine.

However, I no longer wish to use PHP for smaller sites. I want to use Python. This means the server could be running more than ~50 websites, for example. At this point, it seems silly to be running 50 instances of Paster on 50 different ports.

What's the best alternative here?

Cheers.

dave
  • 21
  • 1

2 Answers2

2

Unfortunately, while paster is great for hosting low-level or small sites, the fact that Python's ability to use multithreading (due to the GIL) means that you're essentially limiting how quickly paster can respond.

Paster is just a WSGI server, and what you're looking for is another server that circumvents this restriction. Graham Dumpleton's mod_wsgi is a great (and as far as I know, only) WSGI server that runs through Apache, which means you can use your normal methods for hosting web sites. Configuration is very simple, and the site includes an example for configuring Pylons, of which Pyramid is its spiritual successor.

If worse comes to worst, the mailing list is a treasure trove of information, and you can expect answers to your questions extremely quickly.

Hope this gets you on the right track!

Andrew M.
  • 11,182
  • 2
  • 35
  • 29
2

You should give uWSGI a try. We use on our servers with nginx with virtualenv, and IMHO is one the best way to deploy WSGI apps. It is a bit scary (lot of options) to configure at first, but it's a very powerful application server.

Cyclops
  • 1,169
  • 2
  • 9
  • 13
Giacomo
  • 21
  • 1