[rrd-users] Showing daily average ; from midnight to midnight local time

Jean-Yves Avenard jyavenard at gmail.com
Fri Feb 12 01:37:24 CET 2010


On 12 February 2010 04:19, Tobias Oetiker <tobi at oetiker.ch> wrote:

> this would seem rather odd, is this somehow multithreaded ? If it
> was, it would not matter if the tzset was done in rrdtool or in
> php the effect would be the same.

This wasn't an issue when I was running rrdtool by doing a exec:
exec("TZ=UTC /usr/bin/rrdtool ...")
This forks a new shell ; and there, it's no problem...

I used to run rrdtool that way until I started to experience issues
and massive slow down.
Trying to identify what the problem could be, I decided to move to the
PHP rrdtool module and see if the speed would be improved

To continue calling rrdtool with TZ=UTC, I had to modify the TZ
environment variable within PHP first
That's where some issues started...

I draw some graph with TZ=UTC and some where I don't touch the TZ variables.

The php script is made of two parts.
One that only generated PNG based on arguments provided by the web
client, and the main part simply returning HTML.

That HTML provides lots of link to images.
The web client then issues the GET to all the various images. Doing a
top, I see about 8 rrdtool instances started at the same time when you
access my web page (http://htpc.avenard.org/power)
Changing the TZ environment variable for one graph, should that graph
takes a while to be created, the value of TZ spread to the other
instances of rrdtool/php !!

> in any event, your patch for --utc should be fine ... whatever the
> benefit of it ...

It serves my purpose :)
In any case, it's much easier to do than having to modify a global
environment variable to restore it later...

Now that leads me to my other problems...
When I run each rrdtool graph command individually, they all take
around .05s each...

But when apache starts all of them at the same time, some of them take
up to 6s ... This only started last week. No clue why. The machine is
a 64bits Ubuntu with a E8400 Intel processor (dual core 2.8GHz) with
2GB of RAM...
Always was extremely fast earlier...
Now it can take 20+s for the web page to show locally...

Could there be some locking issues when trying to access the same
rrdtool database by multiple process?

More information about the rrd-users mailing list