View unanswered posts | View active topics It is currently Wed May 08, 2024 7:02 pm



Reply to topic  [ 7 posts ] 
Large Time/ Data Series 
Author Message
pChart user
pChart user

Joined: Mon Dec 27, 2010 12:26 pm
Posts: 5
Post Large Time/ Data Series
Hi,
I am trying to chart some large time/ data series from a mysql db using pchart linechart on a low power pc (guruplug). After a few teething problems I am now able to scrape together a basic chart but my main problem is once I go much over 100 data points I start to get timeout (30 sec) issues.

I am currently measuring the data every 6 seconds and would like to chart daily, weekly, monthly plots. Clearly I can do some data decimation work but I am wondring whether this will always be a 'lost cause' on such a low power pc?

Should I look for a client side (possibly javascript) charting app or do you have some advice that could help?

Thanks in advance.


Thu Jan 06, 2011 1:40 am
Profile
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: Large Time/ Data Series
Hi,

You can investigate in different directions :

1. Use the crontab to generate the charts (and use the set_time_limit() PHP function)
2. Disable AAliasing processing : http://wiki.pchart.net/doc.faq.antialiasing.html
3. Make use of the pCache library (maybe not relevant in your situation)
4. Go for a client side library (JS)

Kind regards,
JD.


Thu Jan 06, 2011 8:41 am
Profile WWW
pChart user
pChart user

Joined: Mon Dec 27, 2010 12:26 pm
Posts: 5
Post Re: Large Time/ Data Series
JD,
Thanks for the reply. I turned off anti-aliasing and that certainly made a difference but still only allows a 'slightly' larger chart.

It appears that the timeout is coming from the class so would the set_time_limit() make a difference?

Code:
Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/energy/class/pDraw.class on line 1754


I would hate to have to go down the js path after getting into pChart.

Thanks again.


Thu Jan 06, 2011 9:08 am
Profile
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: Large Time/ Data Series
Yes it will! But the issue I see is that a web user will not wait 40s for an image to be displayed. For such kind of project, I prefer to go for an MRTG like solution where the collecting daemon also create the static image file so no rendering is done anymore for the web side. (This is what I've done here : http://wiki.pchart.net/doc.real.world.html)

JD.


Thu Jan 06, 2011 9:32 am
Profile WWW
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: Large Time/ Data Series
Hum, just checked the line and it belongs to the drawScale() function which is quiet strange.

Can you please show me your code? I believe that it's a bug I've not experienced yet.

Thanks!
JD.


Thu Jan 06, 2011 9:35 am
Profile WWW
pChart user
pChart user

Joined: Mon Dec 27, 2010 12:26 pm
Posts: 5
Post Re: Large Time/ Data Series
PM sent with code.


Thu Jan 06, 2011 9:56 am
Profile
New pChart user
New pChart user

Joined: Sat Apr 16, 2011 5:39 pm
Posts: 1
Post Re: Large Time/ Data Series
This thread's a bit old, but I doubt the problem is in pChart.

100 data-points is minuscule on today's machines.

As a point-of-reference, I can easily pull 100 OHLC data points into pChart's StockChart from a $300 32-bit Ubuntu machine I bought 3 years ago, running MySQL.
The png is drawn by pchart within a second.

If you are timing out with 30 seconds, you need to break it down - see how long the query takes in command-line mysql first: if that takes a while,
I suspect you are missing an index on a table. If it is fast, there's probably a bug in how you are using pChart.


Sat Apr 16, 2011 5:47 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron