Problem
The following message is shown instead of the graphs:
"Image Expired
Please refresh the page
To view the image"
Lot of people have faced this problem, the reason is the timeout in the caching engine of the Coldfusion keeps the charts for any request only for a default value of 5 seconds.
We missed providing an interface to change this value in the CF Admin, but you can still change this value by:
1. Stop the CF server.
2. Open <cf install path>\lib\webcharts3d.xml
3. You can increase the timeout for keeping the graphs in the cache by editing the minTimeout and maxTimeout attributes:
<?xml version="1.0" encoding="UTF-8"?>
<server image="PNG" cache="Memory" minTimeout="5000" maxTimeout="30000"....
change this to whatever values you want.(Values of minTimeout and maxTimeout are in milliseconds.)
The minTimeout and maxTimeout are per each request, i.e. the graphing cache will keep the graphs for each request for minTimeout amount of time. So if there are 4 graphs in one page then request for the page arrives at lets say 1'o clock and the min timeout is 5 secs, then each graph for the request will be kept only in cache for 1'o clock + time to generate graph + minTimeout. So a problem could be if the last graph takes lets say 10 secs to generate, then by the time it is ready all the previous graphs will timeout and will be removed from the cached.
This can create a problem when:
- There are a large number of charts one page (> 200). In this case, some charts will be drawn but remaining charts will display the error message
- There are only a few charts on a page but some charts take more than minTimeOut amount of time to generate in this case the remaining charts will not be generated and the error message will be thrown.
82 comments:
Yaar, Fundoo CFChart blog. Bole toh, roz aana padega.
-- Arindam Biswas (Coldfusion Developer & RIA Enthusiast)
this is probably extremely stupid, but i cannot find the file
lib/webchart3d.xml
seems it should be in
c:/cfusionMX/lib/webcharts3d.xml
but its not. I'm running
coldFusionMX
thx
d
Sorry for the trouble. I should have specified this post is meant for CF7 - Blackstone and not CFMX 6.1
Can we add this property to an external xml file like you can the style properties? (For those of us using a third-party hosting company, we can't access the primary CF Server files)
Right now there is no way to do this, this is supposed to be a server wide setting. It will affect all applications on the CF server.
You can request your CF hosting provider to increase this limit to more - there is no performance hit (it only improves) - only issue could be that more cache space will be used up. (but I guess they can live with it)
Thanks for a good tip!
BTW, I found difficulty with load ballancing system. Some images still expire. Any idea on this?
1) What kind of load balancing are you doing Terry ?
2) How many charts are there in total on your page?
- Make sure that the cache size of charting is more than the no. of charts on your page.
- You can find out how much time your entire page takes to load up by turning on the debugging from admin. This will help you in finding out if the minTimeout and maxTimeout that you have set are adequate or not.
Do mail in with any experiments that you do, you can mail me at - pswaroop (at) macromedia (dot) com or prayank.swaroop (at) gmail (dot) com
Great find - this works !! ... thanks
Amazing that this information isn't found at macromedia.com. Their fix for this problem is to make sure you have sticky sessions enabled. Thanks for the great tip!
FYI, I run a report thats over 300 pages long (about 3-5 graphs per page) and I had the same issue with the graphs. What I do is generate my graph as a png with cfchart, then immediately save it with cffile, then I reference the image later in my page. So something like this: (fyi, tag brackets are removed so I can put cf code in this box)
cfchart name="TotalsChart" format="png" .....
cfchartseries.....
cfchartdata ...... /
/cfchartseries
/cfchart
cffile action="write" file="#webroot#\images\charts\MyChart.png" output="#TotalsChart#" nameconflict="overwrite"
Then later in my display code I just call the chart like any other image file:
img src="../images/charts/CumulativeYTDChart.png" width="550" height="275"
Some things I have learned is that you really need to specify your height and width of your chart when you create it, and when you call it in the img tag.
Another helpful tip is to run a cf script as a scheduled task nightly (or whenever) to delete the imgs. this is just nice to keep the server clutter free.
since this solution only applies to version 7, is there a solution for version 6.1?
since this solution is only for version 7, is there another solution for version 6.1.
I'm running CFMX 6.1 on linux. Does this file exist on my version and if so where would I find it?
Thanks,
Brad
This post is for CFMX 7. Unfortunately CF 6.1 does not have such a feature.
Hi,
We are using CF7 and right now we are having same Image expired problem. I checked the webcharts3d.xml file.. mintimeout is 30000 and maxtimeout is 60000 plus the cache is set as 100 and cache="Memory". I dont know why we are still facing this issue...
To add to this, I think we are using a seperate report server for the reports generation... Do you think this might cause the prob...
We have 2 machines which host this prodn site and they are load balanced ... we tried to set mintimeout 30000 and maxtimeout as 60000 on the both the webservers by stopping and restarting cf servers but it didnt work... the image are not shown...
In cf administrator under Server Settings --> Charting, the cache type is set as Disk Cache and Disk Cache Location was set as \\10.1...8\foldername which is the report server I mentioned and this is where we want to store the chart images....Can you help on this asap...
I tried the same settings on development machine and since the Disk Cache Location is a local machine, it didnt give any problems with images. I could easily test by waiting for 30 secs and image would expire after that...
Any suggestions for prodn system is welcome.
Thanks in advance,
reply @ ajashadi@yahoo.com.
Hi,
We are using CF7 and right now we are having same Image expired problem. I checked the webcharts3d.xml file.. mintimeout is 30000 and maxtimeout is 60000 plus the cache is set as 100 and cache="Memory". I dont know why we are still facing this issue...
To add to this, I think we are using a seperate report server for the reports generation... Do you think this might cause the prob...
We have 2 machines which host this prodn site and they are load balanced ... we tried to set mintimeout 30000 and maxtimeout as 60000 on the both the webservers by stopping and restarting cf servers but it didnt work... the image are not shown...
In cf administrator under Server Settings --> Charting, the cache type is set as Disk Cache and Disk Cache Location was set as \\10.1...8\foldername which is the report server I mentioned and this is where we want to store the chart images....Can you help on this asap...
I tried the same settings on development machine and since the Disk Cache Location is a local machine, it didnt give any problems with images. I could easily test by waiting for 30 secs and image would expire after that...
Any suggestions for prodn system is welcome.
Thanks in advance,
reply @ ajashadi@yahoo.com.
We have 4 boxes behind a CISCO load balancer. I tried setting the cache directory on each box to a common network share, but that didn't seem to work. In the end, I'm just going to capture the output of <cfchart> using <cfsavecontent> and then replace the image reference from a relative path to one that points to the same machine handling the request.
note: if you are outputting a huge number of graphs, you may need to adjust the cachesize setting in the same line of XML.
This page is an excellent reference.
Thank you to everyone for their contributions and discussion!
2AhzL8 You have a talant! Write more!
colWSs Please write anything else!
vM59AD The best blog you have!
foqum4 Nice Article.
Wonderful blog.
Good job!
Thanks to author.
Wonderful blog.
Nice Article.
Magnific!
Nice Article.
Wonderful blog.
Thanks to author.
D0hfpc write more, thanks.
Nice Article.
Good job!
Magnific!
Hello all!
Wonderful blog.
actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.
Hello all!
Nice Article.
actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.
Nice Article.
Hello all!
Please write anything else!
Energizer Bunny Arrested! Charged with battery.
Give me ambiguity or give me something else.
Suicidal twin kills sister by mistake!
Build a watch in 179 easy steps - by C. Forsberg.
Suicidal twin kills sister by mistake!
Thanks to author.
actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.
Lottery: A tax on people who are bad at math.
A lot of people mistake a short memory for a clear conscience.
The gene pool could use a little chlorine.
Oops. My brain just hit a bad sector.
If ignorance is bliss, you must be orgasmic.
Build a watch in 179 easy steps - by C. Forsberg.
The gene pool could use a little chlorine.
All generalizations are false, including this one.
Calvin, we will not have an anatomically correct snowman!
What is a free gift ? Aren't all gifts free?
What is a free gift ? Aren't all gifts free?
When there's a will, I want to be in it.
What is a free gift ? Aren't all gifts free?
Oops. My brain just hit a bad sector.
Nice Article.
Friends help you move. Real friends help you move bodies.
Magnific!
What is a free gift ? Aren't all gifts free?
When there's a will, I want to be in it.
I'm not a complete idiot, some parts are missing!
Please write anything else!
Give me ambiguity or give me something else.
Good job!
Save the whales, collect the whole set
Good job!
Wonderful blog.
PLease post only relevant comments here.
this is not a solution to the cfgraph problem. still the issue
In my opinion it is obvious. I recommend to you to look in google.com [url=http://cgi1.ebay.fr/eBayISAPI.dll?ViewUserPage&userid=acheter_levitra_ici_1euro&achat-levitra]acheter levitra generique[/url] In my opinion you are not right. I can defend the position. Write to me in PM.
Post a Comment