[mod_python] Graphs in a webpage

Ben Leslie benno at sesgroup.net
Tue Nov 14 10:25:14 EST 2000

> This may be the wrong forum for this, but......

> I am not sure whether reading the ASCII files is slow and whether sticking
> them into a database will be worth the effort (ideas, anyone?).  I get some
> advantage when running apache single-threaded by checking whether my data is
> already loaded, but as soon as I run apache normally this advantage
> disappears.

Database is almost always going to be slower than reading from ascii files.
> I think the bottleneck is creating the graph, and in trying to solve that I
> have a few questions regarding how mod_python works.  How long does an
> instance of mod_python exist?  When is an instance destroyed?  What data can
> be passed from one instance to the next? 

There is one insatnce of you handler is created for each apache thread. So
it will be there until the apache thread is killed. You can therfore cache
data between requests. I think you can communicate between different threads
but you probably don't want to.

I doubt mod_python would be your bottleneck. How long does graph.py take
to create a graph from the command line?

> Also, does anyone have any ideas
> on how to efficiently generate graphs from a reasonably large number of
> datapoints?

Gnuplot maybe.



More information about the Mod_python mailing list