[mod_python] Graphs in a webpage

Alexis Iglauer aiglauer at iname.com
Tue Nov 14 00:03:25 EST 2000


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

I am writing an app which takes data out of text files and makes graphs.
The user interactively specifies the graphs in a browser, with everything
being done in Python as a handler.  The resulting page can have 10+ graphs
on it.

Problem is, my solution is sloooooow.  I am using gdchart to generate the
graphs on the fly (<img src="grph.py?color=0x0000ff" alt="xxx"> and plain
vanilla python for the rest.

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.

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?  Also, does anyone have any ideas
on how to efficiently generate graphs from a reasonably large number of
datapoints?

Thanks in advance
Alexis




More information about the Mod_python mailing list