GregorTP

High CPU Usage, Browser Crash with wmode and Multiple Graphs

Recommended Posts

OK, I "patched" Column2D.swf so it has a rate of 20 fps.

Now I can display 40 of these on the same page in firefox with my CPU level around 6%. (still a bit high in my opinion, but this is much better than the previous 100% with firefox hanging)

Regards,

Bernard.

Share this post


Link to post
Share on other sites

Hi Bernard,

 

 

 

How did you modify the swf file to make that change?

 

 

 

I'm looking for any workable solution at this point.

 

 

 

--Gregor

Share this post


Link to post
Share on other sites

I use a home-grown java tool based on a third-party library (JavaSWF2 - BSD license). This was just a proof of concept to test the theory.

 

 

 

This is really easy to change from FusionChart standpoint. They only have to change a single parameter. At least that is true for most of the charts. (Some of them, like the Pyramid, is basing their "animation" on the framerate which explains why it got random speed in the first place (some browsers limit the framerate)).

 

 

 

Now that we know it is easy to fix, I hope FusionCharts fixes it quickly.

Share this post


Link to post
Share on other sites

But in FusionCharts, when the chart has been rendered, the FPS actually drops to 0, as the last command in the chart is stop(), which prevents any more frames from running.

Share this post


Link to post
Share on other sites

Even so, Pallav, when multiple charts load at once, it is enough to crash a browser. It would be unreasonable to chain the loading of the charts, to make one load after another's animation stops. And it still remains that 120 fps, or even the browser-limited maximum frame rate is unnecessary for chart animation.

 

 

 

We have been having this problem as well, and many of our clients' browsers do not survive a dashboard with eight 100x100 px charts. It is likely that the problem is aggravated by poor flash-browser integration (as seen by a higher CPU spike and constant CPU load in Firefox, than in IE), and thus is not entirely the fault of FusionCharts, but please do what you can to alleviate this issue for your paying clients. Please limit the frame rate to something more reasonable. At the very least, please expose this parameter for runtime xml configuration with a sensible default.

 

 

 

Thanks,

 

Ryan

Share this post


Link to post
Share on other sites

I do not know the full theory behind it, but in practice, there seem to be a problem. At least this is what I was experiencing. It may not apply to all.

 

On my machine, when showing 8..10 charts (that appear to be static after their first animation), it really eats 100% CPU.

This is very noticeable in Safari (for windows) but firefox and others are also affected. In Safari, you just monitor the CPU and as you add more chart to the page, the CPU just goes up by about 5-10% per chart.

Firefox 2.0.x has another issue which aggravates this: if too much cpu is used, it actually "semi-hangs" firefox (cannot resize window and cannot access menus but hyperlinks work and you can move the firefox window).

 

"Patching" the fps to a reasonable level (I picked 20 fps) repaired all that instantly. Mocking with the .swf files "works" but is not an acceptable solution for me. For those that have the source (and the tool to edit it), just open the .fla file in Flash and change the fps setting when rebuilding the .swf file. But again, we would like to have it fixed correctly when we upgrade to future versions. Like a said, that fix does not work for all charts (like the Pyramid) because it seems the animation is fps-based (animation should always follow the the time, not the framerate).

Share this post


Link to post
Share on other sites
Pallav (5/23/2008)
But in FusionCharts, when the chart has been rendered, the FPS actually drops to 0, as the last command in the chart is stop(), which prevents any more frames from running.

 

 

 

I've been programming long enough to know that what I think is happening and what is actually happening are not always one and the same.

 

 

 

--Gregor

Share this post


Link to post
Share on other sites

has this bug issue been fixed? If so I need to upgrade my software...

 

 

 

If not, I am using FireFox 3 RC2 (The final version is to come out on June 17), and I am having an issue with CPU Usage as well. I have a dashboard with about 8 charts on it, and my CPU goes to about 50% and I can barely use FF3 at all. We are using wmode=transparent.

 

 

 

What can I do to fix this problem? When will it be fixed? We do not want our web pages crashing the browsers of our clients.

 

 

 

Thank you.

Share this post


Link to post
Share on other sites

I totally agree this has been going on long enough. Out of our 8 charts on our dashboard only 1 is transparent yet in Firefox my PC just locked up and crashed. It seems people have found a solution by adjusting frame rate. I really think this should be a priority for Fusion Charts. Crashing clients computers is not a good thing...

Share this post


Link to post
Share on other sites

I am still experiencing the issue reported by everyone else. Firefox (2 or 3, doesn't matter) consistently reports "Transferring data from x ..." and the CPU hangs at 50% when only loading 4 charts in an Extjs layout.

 

 

 

In IE 7, once the charts "load", all content loading/rendering is done. No extra CPU cycles, no worries (other than this only works in IE).

 

 

 

 

 

I'm also providing XML via the Rails renderChart functions. This is not due to Extjs nor Rails, as the issue persists with plain HTML and the basic fusioncharts JS functions.

 

 

 

 

 

edit: This only happens with fusionchartsWMode.js. fusioncharts.js is not affected.

 

 

 

 

 

edit: I really hope this can be resolved by the fusioncharts team, if it isn't purely a "Firefox bug".

 

Regards.

Edited by Guest

Share this post


Link to post
Share on other sites

Firstly, I'm really glad to have found this topic - and therefore know I'm not the only one suffering this issue.

 

 

 

I had thought it was something dodgy in my coding - but couldn't figure why IE was ok - but FF not.

 

 

 

I use FusionCharts for internal corp dashboards. As IE is the only 'officially' supported browser by IT - I can use that excuse for a while. However, there are > 20 key customers (and me) who are FF users, so this is not really workable.

 

 

 

I eagerly await a fix - either from the FC team or the outcome of the Bugzilla report....

Share this post


Link to post
Share on other sites

Hi everybody,

I use fusionchart to create dashboard and reporting in my company.

I had this problem but I'd fixed it, It seems that is due to the fps of the swf files.

So the solution I choose is to use a new swf file with a 20 fps frame rate as bernard sugest it (thanks to him).

If you want to use a lot of swf without animation you can put the frame rate to 0 but I realy don't know if it change a lot, I have to test.

Here's the procedure :

1. Install the PEAR Package.

2. Install the FILE PEAR PACKAGE.

3. Download the PEAR::File class (by Alessandro Crugnola) here : http://www.sephiroth.it/weblog/archives/2004/07/pearswf_updating_read_and_modify_swf.php

4. Include the class to your php file.

require_once('File_SWF.php');

5. Here's the script I use in the top of my page :

I test if my new swf file exist, if doesn't I create new one with the old one and a 20fps.

if(!file_exists('packing_by_agency.swf'))

{

 $flash = new File_SWF("Doughnut2D.swf");

 if($flash->is_valid())

 {

  $flash->setFrameRate(20);

  $flash->write("packing_by_agency.swf", 1);

 }

}

6 . Then you include the new file created to your dashboard, for exemple :

renderChartHTML("packing_by_agency.swf", "", $str_xml, "packing_by_agency", 958, 500, false, false);

For 35 to 45 swf in the same web page :

- Before this I have always a cpu ~45-55%.

- Now I have always a cpu ~00-05%.

N.B. : It's better if the wmode is not transparent.

Share this post


Link to post
Share on other sites

Hi everybody,

 

 

 

unfortunately the official browser in my company is Firefox... and I have to create both static pages (HTML) and dynamic pages (PHP). I'm using the free version and I hope that this bug will be fixed as soon as possible.

 

 

 

I've just cut & copied the sample HTML code 5 times, in order to show 5 different charts referring the same XML, and my CPU simply has gone at 100%. No *special* attributes have been specified... just the one provided in sample code.

Share this post


Link to post
Share on other sites

Hi everybody,

 

I am new to FusionCharts and using V3 evaluation version. I have implemented 10 charts in a HTML page with wmode='transparent' and bgAlpha='20', also set a landscape image as HTML background. Surprisingly my FireFox does not produce high CPU usages or any crash etc. same on IE. May be I think it depends on Processor, Memory, OS, etc.

Share this post


Link to post
Share on other sites

Hi all,

 

 

 

I'm on the verge of (as in hours away from) spending at least ~$5,000 on this suite of software, but to be perfectly honest this thread has me quite worried. We've spent the last couple days doing a great deal of diligence on this decision (including a bunch of work to work out our own solution for server-side image generation from the Flash, so that we can use the charts in PDF/Prints), but then we hit a roadblock which *sounds* like its described here.

 

 

 

Basically in Firefox, if we have more than a few charts displayed (as few as ~6) our CPU spikes up out of control. I'm on a dual-core machine myself, and one of the cores hits 100%, and effectively stops Firefox entirely. IE on the other hand barely shows any CPU usage at all (~1%). Opera seems to use very little CPU, but is generally unresponsive, and Safari is about as bad as Firefox (completely unusable, halts). My developer doing the work is experiencing the same effects on his box.

 

 

 

Unfortunately in our scenario, we're replacing a simple html based chart system (mocked bar graphs with gifs basically) where our customers can create a number of reports on one screen (anywhere from 4 to 25 is common) - so we need that capability in our new solution.

 

 

 

One thing that is strange to me, is that the talk of wmode stuff doesn't apply to us at all. We've actually tried with or without that option enabled (ultimately I *think* we'll need it, as we have a semi-transparent lightbox which covers the screen on session expiration) - but regardless, we have the problem in either case.

 

 

 

Outside the software itself, as said in a previous post, the customer support on this issue is troubling to me. It seems as though one user has figured out a solution for this (the 20 fps thing), which it seems could have been modded into the software to potentially solve the problem - but the FusionCharts team doesn't seem to have commented on this at all (unless I missed it). And while I'd like to try the hack - the solution presented is a PHP solution, and we're dealing with a legacy ASP system. Not to mention - I'm not really comfortable settling on a hack for our brand new system, nor do I feel I should have to with what we're paying.

 

 

 

That said, I appreciate that a bug has been filed with Mozilla, but that doesn't do anything for us today - and apparently it wasn't a big enough issue to keep FF3 from being launched, so who knows what priority that will ultimately get. On top of that - many of our customers use Firefox, or Safari - both which are currently unusable for us.

 

 

 

Anyway, I'd appreciate some feedback on this. As I said, this Problem/Thread is keeping me from buying. If I can find a workable resolution, I think we (and our customers) will be really happy with this solution.

 

 

 

Thanks,

 

Luke

Share this post


Link to post
Share on other sites

The solution from emageren above works perfectly. Here's a more detailed step by step process of getting it up and running if needed. By the way, I'm testing this on a wamp stack installed on Windows XP Pro running MySQL 5.1.24rc, PHP 5.2.6, and Apache 2.2.8 so these instructions are for that type of environment. If you're on Linux none of this should be an issue.

 

 

 

1. Download and install PEAR from http://pear.php.net/package/PEAR/download. Read through the documentation to get it installed. If you don't have a program to unzip tar.gz files then download 7zip and install it. You'll have to extract the gz 1st which will leave you with a tar to extract. If you have wamp installed just go to the wampbinphpyour-php-version folder and run go-pear.bat. Take note of where PEAR.php are and tell it to add the path to your environment and htaccess docs.

 

 

 

2. Download the PEAR File extension from http://pear.php.net/package/File and extract it. Place File.php and the File and tests folders where ever you want, but be sure to tell File.php where the folders and PEAR.php are.

require_once('path to PEAR.php')

etc.

 

 

 

3. Download the PEAR SWF writer from the link emageren gave in number 3. Place it where ever on your web server and tell it where File.php is.

 

 

 

4. In your pages that load these charts add the php require statement to the top with the correct path to File_SWF.php.

 

  

                <?php

                require_once('File_SWF.php');

                ?>

 

 

 

5. After the body section of you page before the queries and settings that feed your chart place the code in step 5. posted by emageren. Change the swf file names and paths on the first and last lines to where ever you want or to the folder holding your swf files. Change the swf file name and path on line 3 pointing to the Fusion Charts swf to whichever chart you want to redo. Change the setFrameRate() value to whatever you want. I lowered all of mine to 40. If you have tons of charts on your page (more than 20) you may want to lower it to 20 or less depending. Just toy with it and see. Here's an example from my page:

 

 

<?php

 

 

 

//remake swf file to change FPS from 120 to 50 so pages with many charts don't hang

 

if(!file_exists('../Flash/newLineChart.swf'))

 

{

 

$flash = new File_SWF("../Flash/FCF_Line.swf");

 

if($flash->is_valid())

 

{

 

$flash->setFrameRate(50);

 

$flash->write("../Flash/newLineChart.swf", 1);

 

}

 

}

 

 

 

// Connect to the DB

 

$link = connectToDB();

 

 

 

//Before this insert your code to connect to database (MySQL) = $link

 

$strQuery =

 

[code/]

 

 

 

6. In your echo renderChartHTML or in your $FC explanation statements change the name of the chart to the one you're going to create.

 

[code] //Create the chart

 

echo renderChart("../Flash/newLineChart.swf", "", $strXML, "", 405, 300, false, false);[code/]

 

 

 

7. Open your page and watch the the slowness! Afterward go to the folder your flash chart files are in or the folder you told it to make the new swf file in. You'll see the newly created swf file. Point all your pages that use that chart to the new file.

 

:w00t:

Share this post


Link to post
Share on other sites

Hi bonhamjh,

 

 

 

Forgive me but I'm a tad confused - Is this something I'd only need to do once? I can't even remotely justify installing WAMP or PHP on all of the servers our application runs on - although I could have my developers do this once for each chart, if I can then just copy the hacked SWFs to all the servers.

 

 

 

That said, why am I paying $5,000+ to install PHP and hack the files I'm purchasing? Why can't FusionCharts fix this themselves, or at least respond? Obviously I'm not the only one frustrated by this...

 

 

 

=Luke

Share this post


Link to post
Share on other sites

Sine909,

I just sent an email reply back to you that explains the process.  You only have to do this once per swf you want to change then point your chart pages/containers to that file.  As to why Fusion Charts can't do this I don't know.  It's only one setting when creating the swf in Adobe so it would be easy to change it.  Since the files are protected I can't edit them in Flash so the PEAR way was the only free way I could find, and it's easy.  Like I said you can do this on a desktop or laptop once to each swf.  You can make the new file name the same as the Fusion Charts version if you want so you don't have to change anything in your pages.  Hope this helps everyone.  I had a page with 15 charts on it and started noticing this slow down as well so the PEAR route was a very welcome surprise.  Thanks again emageren for providing it!

Share this post


Link to post
Share on other sites

One last note.  I noticed everyone talking about this being a browser issue or Firefox issue.  It isn't.  This is all comes down to the swf files themselves how good the hardware is you have it running on.  Since the swf files are rendered locally it will be specific to each computer accessing your charts.  If you've got a lot of high end graphics computers going to them they'll be fine.  If you've got a lot of the average corporate low end machines accessing them they'll be slow which is why you'll want to remake the swf files with lower frame rates.  Again, Fusion Charts could and should change these files to use lower frame rates so that this isn't an issue.  You can't really tell the difference between one of these charts loading at 120 fps or 60 fps.  And the end users really won't.  Have a good one. :smooooth:

Share this post


Link to post
Share on other sites
bonhamjh (7/25/2008)
One last note. I noticed everyone talking about this being a browser issue or Firefox issue. It isn't. This is all comes down to the swf files themselves how good the hardware is you have it running on. Since the swf files are rendered locally it will be specific to each computer accessing your charts. If you've got a lot of high end graphics computers going tothemthey'll be fine. If you've got a lot of the average corporate low end machines accessing them they'll be slow which is why you'll want to remake the swf files with lower frame rates. Again, Fusion Charts could and should change these files to use lower frame rates so that this isn't an issue. You can't really tell the difference between one of these charts loading at 120 fps or 60 fps. And the end users really won't. Have a good one. :smooooth:

 

 

 

Thank you for the response, but from my experience Firefox does seem to be a culprit here. As I stated in my previous post (and others had the same experience) - IE renders the page without a problem at about 1-2% of one of my cpu cores. It's completely responsive, and scrolls with no problem. The charts work great. Firefox absolutely caps out one of my 2 cores, so much that the thread effectively halts Firefox so that I have to close the process entirely. Bad mojo.

 

 

 

As for the type of machine - I could be wrong, but I don't think graphics card should have too much to do with it. I don't believe Flash even supported hardware acceleration until 9, but FusionCharts are using Flash 8. But that said, I have a PCIe DX9 graphics card with 256MB - Not high-end, but definitely not Intel Integrated either. My CPU is a dual-core Intel. Not the latest, but not a slouch by business standards. My home machine is much more high-end, I'll try it here as well.

Share this post


Link to post
Share on other sites

Hi,

 

 

 

For anyone who needs the 20fps version of FusionCharts, just drop us an email at support [at] fusioncharts.com

Share this post


Link to post
Share on other sites

This was a great post.  ( fix our cpu problems )

I ran into cpu usage issues many months back when trying to use  the wmod=transparent.  Our dashboard had issues in both IE and FF.  We are running an internal dashboard under FF2, we have probably 40 browser windows open with 60-65 flash objects.  We pretty much eat up most of the dual core, we run two instances of FF and both processes consistently use 35 - 50 %.

We tried FF3 with just 1 browser window and 5 flash objects and it immediately hits 50% cpu.

Today I set the framerate to 5, since we are not doing any animation, and our dashboard now averages about 10-20% cpu usage.

Share this post


Link to post
Share on other sites

Yeah, I am wondering what the deal is as well.

 

 

 

We really need a fix within the next month or so for our release...

 

 

 

--Chris.

Edited by Guest

Share this post


Link to post
Share on other sites

Same... We were actually sent the 20fps charts for this - but if we update to the new version for the other fixes, it sounds like we lose our 20fps?

 

 

 

Also, we purchased an enterprise license for the whole suite, so we don't have them for charts/widgets/power either.

Share this post


Link to post
Share on other sites

I don't want to assign blame here, but there has clearly got to be a solution that FusionCharts can offer. This is not Firefox. This is not Flash. Or, at least, this problem is theoretically solvable by FusionCharts.

 

 

 

http://fusioncharts.com/Demos/SalesDashboard/

 

That page puts my CPU at 50-52% on a fairly beefy machine.

 

 

 

Amcharts (a competitor to FusionCharts who also uses XML driven flash) has a home page with 5 graphs on it:

 

http://www.amcharts.com/

 

 

 

My CPU bounces around 6-11%

 

 

 

This is in FF3.

 

 

 

So the question is-- what is AmCharts doing differently? The animation is just as pretty. The graphs are easily as complex (no gradients, though).

Share this post


Link to post
Share on other sites

The 20fps charts seem to work fine (I believe the distributed ones are at 30fps). The question is, why the 20fps charts aren't distributed yet. I'm assuming they're trying to find some other fix that doesn't remove frames, but who knows until we get an answer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now