Harmonious and GLSR in harmony

It’s been a while since my last entry about harmonious and like-wise; a lot of work has been done.

A large majority of the server basics have been implemented (some only partially): sessions, domain module loading, serving up static files and the templating engine. A couple of extras have also been added: restricted directories (very similar to Apache’s htaccess) and support for virtual hosts.

Oddly enough, I’ve started to enjoy going to bed so I can lay there thinking up weird and wonderful ideas. That doesn’t mean I’m going to bed any earlier than usual though 😉 No doubt I’ll implement many in the future, persistent connections and SSL are both a must.

Next up is getting the thing all threaded up, my current ideas for how to do this goes a little something this…

As the server starts up, it starts a base number of worker threads that sit there waiting to processes requests that enter the queue (this is how CherryPy works). If a request comes in and there is another request waiting in the queue for a thread to process it, the server will create a new worker thread. At scheduled intervals the server will check each worker thread to see if it’s processing a request or not, if two or more are not doing anything, the server will kill one or two of them. The server can either have a max-threads configuration option set or allow the server to find the optimal amount of worker threads by monitoring the average time taken to process requests.

I have a feeling the server will be need to be under some pretty intense loads (and hence a large number of threads) before it decides on an optimal amount of threads. Heh, I’m not even too sure the server *will* be able to discern an optimal amount, I don’t know enough about the effects threading has on the system. Comments are welcome on this.

As for GLSR (GLEP 15), we have it running on Harmonious which was a rather painless process. Scott Hadfield (hadfield) even commented that he enjoyed coding with the Harmonious framework. I couldn’t agree more, it feels a lot cleaner and more organised than that pure CGI crap we were using before. Though I’m biased 😉

On a personal note, I’m off on holiday for 1 week in the Italian alps, tomorrow. My first in 3 years! I’ll try my hardest to uphold the typical drunken-Englishman stereotype 😉