Elements or Lower

Wed, 23 Jun 2004

More on the SVG::TT::Graph Problem

Not long ago, I wrote about some problems I’d encountered with integrating SVG::TT::Graph into the log analysis system within my CMS. I’d figured out that caching the generated SVG files on disk and displaying those avoided the problem of the graph never actually making it through to the client.

Well, it turns out that this wasn’t the whole story. It seems that running the module in a mod_perl environment can cause a graph to be created empty if the Apache child process running the request has already created a graph at some point in its lifetime. So, whenever I restarted the server, the graph would work — and of course it would sometimes work without restarting the server, depending on which Apache child process got picked to handle the request.

Evidently something’s setting a variable that isn’t being destroyed properly between requests in mod_perl. Try as I might, I can’t find out whether it’s something in my code, or in SVG::TT::Graph itself.

So, I’ve edited my code to run the graph creation as a regular CGI script instead of a modperl registry script, and it now genuinely works every time. The additional overhead of running it through CGI rather than modperl is troubling, but hardly a bottleneck in terms of speed — that honour goes to the volume of data in the log table of the database.

Hopefully, I’ll be able to find the problem with running it through mod_perl and correct it, but at least for the time being it actually works.