Forum OpenACS Q&A: Response to Simple caching of html content

Posted by John Sequeira on

Thanks for the plug, but I expect the initial implementations of portable.nsd will be more memory-hungry than a straight AOLServer implementation. With OpenACS/FastCGI, we'll be running multiple single-threaded interpreter processes instead of one multithreaded process, each initially chewing up memory for caching. OpenACS/tclHTTPD has the potential to be multithreaded, but I'm not sure what it'll take to get all the dependency libraries to cooperate. Michael C is right now working on how to do multi-process nsv's with sockets, but based on recent progress I think I'll beat him to a deliverable :-).

Right now I've reimplemented nsv's as globals,  which probably took 15 lines of code. I was thinking that for development it might be good to have an implementation that writes to the database (like ASP.NET's caching) so you can keep an eye on the values.  For production sites,  this approach might make sense for low memory sites or web farms.  For now, TclPro's variable inspection makes the debugging usefulness of db logging a bit moot. It really easy to look at any variable at any stack level,  so no rush there.

There is one slight memory optimization I'm working on right now: replacing the query dispatcher with a source code preprocessor. Instead of parsing/caching xql files, I'm parsing the source code and writing the correct query into the tcl files. I needed to do this to make nstcl happy (which has no qd), but it has some other benefits wrt interpreter launch time, a good thing when using FastCGI.