SCGI is a form of caching

May 25, 2006

This is perhaps an obvious observation, but I've recently consciously realized that persistent SCGI and FastCGI daemons are a form of caching of regular CGI programs; rather than caching data, they're caching code and often configurations. Thinking about them this way has made several things clearer to me.

As caches, they have all of the usual concerns with detecting and dealing with cache invalidation, complicated by the fact that few environments have really good support for loading new versions of your program's code on the fly. Even fewer can cope with data structure changes.

While I have my reasons for disliking resorting to caching, I don't wind up feeling that using persistent daemons is giving in in the same way. I think the reason is because the speed problems that prompt persistent daemons are beyond my control; how fast CGI processes start is mostly up to the operating system and the language interpreters. (Some of it is how fast my program parses its configuration files, but this is usually a small portion of the time.)

This doesn't mean that I like SCGI daemons et al, but I dislike them for different reasons: they're harder to manage, partly because of the caching issues, and I often feel that they shouldn't be necessary. Just running CGI programs directly means that I am always using the latest code and configuration and so on, and if something goes wrong it goes wrong very directly and immediately. (And if it works it's going to keep working.)

Written on 25 May 2006.
« The not so secret history of vmlinuz
A Linux su surprise »

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

Last modified: Thu May 25 01:14:01 2006
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.