Over the past few days, I've been evaluating a new host (I'm looking at moving from shared hosting to a VPS). We have several applications running on SISCweb (the web framework that marries J2EE and SISC), and this blog runs on Wordpress, so there was the usual fun of configuring Apache, PHP, Tomcat and mod_proxy / mod_jk. At the end of this, unsurprisingly, Tomcat used the largest single amount of memory, though not as much as some doomsayers predicted.
Seeing that memory is the main bottleneck, I set out to optimize the setup a bit. Previously, each web application ran its own private copy of SISC and SISCweb. The most obvious step is to share SISC between all web applications.
It turns out that SISC has the concept of running several Scheme "applications" in the same interpreter, with separate heaps and absolutely no interference. To do this, one must create multiple
AppContext instances and juggle them when calling Scheme from Java. This is a rather neat feature and one that I haven't seen in other Schemes. It's even possible to launch a new "application" from within Scheme.
When I tried to share SISC between multiple SISCweb instances, I ran into problems. It was clear that applications were stepping on each others'
AppContexts and overwriting global SISCweb book-keeping structures. Looking at the code, I found that SISCweb was not designed with the possibility of a shared SISC interpreter in mind and relied on an implicit default AppContext whenever calling Scheme from a servlet.
To make a long story short, I made a few fixes and this is no longer the case. I can now run several web applications (even for different virtual hosts) in the same SISC instance. The patches will be in the official SISCweb repository as soon as Alessandro reviews and publishes them.
Oh yeah, I almost forgot. Happy New Year!