WebSeitz/wikilog
z2006-09-30- Mccallister Web Scripting Platform
is a Product Manager/CTO with a track-record of bringing a business perspective to building agile product-development teams for start-ups, and is seeking a senior role in an entrepreneurial organization building disruptive Internet-driven products.

(backlinks off) (map off)
(search off)
last edited by BillSeitz on Oct 16, 2008 8:10 pm

seeks an architecture providing a robust general web server designed for writing -s.

The real goal was to find a good way to run Rails and and and whatnot on [HTTPD]. Should be trivial, right? Sadly, it is not. Nor is it trivial to do it on , nor much else. The only easy ways to run rails are on webrick or . Seriously. Neither of these is a good option as a primary web server, which is unfortunate. The situation is similar for Python, though I don't do much python work anymore, so I'll keep my trap shut on that front ;-) There is an obvious option for a robust general designed for writing web apps (). To maximize it though, you need to use an mpm other than prefork. The main reason you need to avoid prefork, for ruby and python apps, is the massive memory footprint engendered by loading a ruby or python vm in each httpd process. They both have fairly hefty memory requirements for their [VMs], so having lots of processes (which can work fine for small systems, like ) gets painful disturbingly quickly. You need prefork to run them in process because they both have, basically, broken behavior with regard to posix threads. The alternative to having a per httpd process is to have a pool of processes and play games with various protocols to hand off the request to the the scripting . The aforementioned is a popular option, just proxying () the is another popular one, [AJP] is yet another, as is . This is what we all wind up doing not just in and , but also in Java (where [AJP] dominates). This certainly works, but it would be nice to not add the network (or domain socket) hop if we could help it.

The basic problem, in my opinion, is that (and ) both like to be the language. You extend them, you don't embed them. You use ruby to drive C, not C to drive ruby. Extending ruby is fun and easy. Extending httpd with ruby is pain... So, in my copious free time I have been trying to find a good way that works with httpd rather than against it. I really do believe that -s are the best way to glue most webapps together, so I want to keep that. In order to work nicely with httpd the language has to be fairly agnostic with regard to running in a multithreaded server (or even a single thread for everything server like lighttpd (I think)). So, I go looking for a scripting language that does play nicely therein (Ruby doesn't - I love ruby, I use ruby daily, but it is crap for embedding in an embarrassingly concurrent, multithreaded server).

It is surprising how bad the state of robust, thread-friendly scripting languages is. I found three (and a half) so far that look like they'll fit my needs. It is a surprising list until you think about it. They are , (), and . The half is Ficl. I am not sure it works yet, but it should. It should also give me lots of headaches being Forth based :-)

The shocking part of this list is that there is not a single on it... There is a big benefit to working with something that sees itself as the first class citizen - they tend to have better^w more extensive libraries. For libraries, > > > > > > . That said, C and have them all beaten, and hooking C into Lua, at least, is even more trivial than with Ruby or . It just means embracing C, which is something people have been working to escape. C is really good at slinging bits around on unixy systems though. Really, really good. Pretty much better than anything else, even if it is not as nice on developers as other languages/environments.

So, where does this ramble lead? I have been playing around a fair bit with + C libraries + httpd (modules) based webapp development. I really like it.

See : |


 




Bill Seitz, fluxent at gmail dot com, Weblog