DragonFly BSD
DragonFly kernel List (threaded) for 2003-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

alternative httpd: was re: sysinstall 2

From: cmulcahy@xxxxxxxxx
Date: Thu, 04 Sep 2003 00:26:31 -0400

On python webservers ...
Zope is probably waaaay to much.

how about medusa + quixote ?

medusa ( http://www.amk.ca/python/code/medusa.html : 107K tarball )
( historic http://nightmare.com/medusa , good async links )
quixote ( http://www.mems-exchange.org/software/quixote : 190K tarball )

adds 2 extra directories to $PYTHON_HOME/site-packages/

Code is small and easily modified/maintainable

medusa is written by Sam Rushing, who authored the asynchronous socket libraries in the standard python distribution. ( the DNA is evident )
It forms the basis of the "web-server" component of the vastly more complicated Zope package. ( I assume zope's medusa components may well have diverged from the standalone medusa by now, but I haven't checked. )
The Async stuff is very fast & scalable and simple once you get the hang of it. All work is performed in non-blocking tasklets scheduled from a select/poll loop in one process. No forks, no threads. You could implement the main loop in C if you are really crazy about performance; even hook into kqueue instead of select/poll as the twistedmatrix guys have done in their framework ( in a freebsd-specific reactor. )
Small footprint, easily comprehended, very good performance.
A single process can have multiple protocol handlers including http,ftp,(rudimentary) chat, xmlrpc, dns resolver and ( my favorite ) a "monitor" server that allows one to telnet in and get an interactive python session inside the namespace of the running server.
It is not heavily developed, but it is small & solid. A.M. Kuchling has taken over maintainence from Rushing, and has just released a new revision (9/03)

quixote is a templating framework that is typically run as a standalone process that communicates with apache via FastCGI or SCGI, but it can also run within python webservers like medusa or twisted. It is similar to Zope in that urls are not necessarily paths to literal files, but rather method calls on remote objects ( but it is far more light-weight than Zope, and without web-gui-centered administration )
ie. ( if i remember correctly )
becomes foo.bar.bobo("http-request-object")
and the result of this method call is returned to the client.
It has also has PTL ("python templating language") for creating html.
Its not quite "Code inside of HTML" easy like PHP or ASP, but I'm not sure thats a bad thing.

On the back end you can do anything you can do with python.

Small footprint on disk, during, & after install.
Quick Development & extensible.
Disapears amongst all those python libraries after install. ;)

Just a late night musing.


Garance A Drosihn writes:

At 8:35 PM -0400 9/3/03, Richard Coleman wrote:
 If apache was to be replaced, I would suggest finding a very
 basic, pure Python web server.  Something that is very easy
 to understand and modify.  I'm sure many people here could
 write one if necessary. Although a production web server is a
 big project, a simple web server is actually pretty easy.  It
 probably wouldn't take more than 300 lines of Python (probably
 much less).

I suspect this project's resources would be better spent using
an already-existing web server. I have no suggestion of whether
that should be apache or zope or thttpd (if we want something
really small), but I don't think we bring any special ideas to
the writing of a new web server. Even if that takes only 300
lines, I'd rather see those 300 lines spent on a "really Fly
installer" than a hum-drum web server.

Garance Alistair Drosehn            =   gad@xxxxxxxxxxxxxxxxxxxx
Senior Systems Programmer           or  gad@xxxxxxxxxxx
Rensselaer Polytechnic Institute    or  drosih@xxxxxxx

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]