The pain (or annoyance) of deploying a simple WSGI thing

September 17, 2013

It started on Twitter:

@eevee: it is time once again to set up a small innocuous wsgi thing and i am again reminded that this sucks and i want to fix it so bad

@thatcks: If only deploying a WSGI thing was as easy as PHP. And I wish I was making a joke there.

(Note that @eevee is the author of the infamous rant PHP: a fractal of bad design.)

Some number of people are now thinking that there's no problem here and that WSGI apps are pretty easy to deploy. After all there's lots of WSGI servers, many of them quite good, and it's not like it's hard to hook one up to your main (or frontend) web server. An entry here, an entry there, a new daemon process, and you're done. Maybe you even use Apache's mod_wsgi, which gets it down to a configuration entry (and a server restart, but you probably needed that anyways).

Well, here's the simple PHP deployment process: put a .php file in the appropriate spot in your web server's document root. You're done.

(As noted by @bobpoekert, CGIs also have basically this property.)

Yes, yes, of course there is a great pile of stuff behind the scenes to make that work. And of course it isn't as flexible and as scalable as the full bore WSGI version. But it demonstrates what a simple deployment actually is and frankly a simple basic deployment is all that 99% of all web apps need (the existence proof is all of the basic PHP apps). Even a relatively full-featured WSGI deployment should only require two files and nothing else (one actual .wsgi file and one file to describe things like what URL it connects to), with the pieces to make it work integrated with your web server.

(The actual running of your WSGI app could be in a separate container daemon that's handled by a separate supervision process. That's an implementation detail that you shouldn't have to care about for a simple WSGI deploy process any more than you should have to care about the details of how your web server communicates with your WSGI app.)

As a side note, as a sysadmin I happen to think that standalone daemons are both a pain in the rear and utterly the wrong approach for a scalable deployment of lots of apps with unpredictable load. But that's another blog entry.


Comments on this page:

Passenger basically does this for WSGI apps (it was invented for Ruby on Rails but it also supports WSGI). Put passenger_wsgi.py in your document root and you're done (of course you need to tell your web hosting company that you want to use Passenger on that domain, but you need to do that with PHP too).

Written on 17 September 2013.
« Regular expression performance and performance folklore
Reconsidering external disk enclosures versus disk servers »

Page tools: View Source, View Normal, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Tue Sep 17 00:15:20 2013
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.