why is firefox such a CPU hog?

Scott Balneaves sbalneav at legalaid.mb.ca
Mon Nov 16 20:10:32 GMT 2009


On Mon, Nov 16, 2009 at 11:08:37AM -0800, john wrote:
> Hi Asmo,
> 
> On Mon, Nov 16, 2009 at 10:36 AM,  <asmo.koskinen at arkki.info> wrote:
> 
> > Do you know what they are doing/what kind of web pages they are surfing -
> > flash, java, lots of pictures, some kind of embedded movies or embedded
> > audio players, lots of popup windows and so on - FF has n+1 plugins - bad,
> > bad dog. But maybe FF is not so bad, but bad design for web pages can do
> > that.
> 
> They are probably surfing all of the above, since that is the nature
> of the web these days. I think If
> LTSP is going to be viable

Right, because we're only celebrating our 10th anniversary.  It's not like
we're viable or anything :)

> it has to be able to work at least as well
> as other computers that kids use
> e.g. 4 year old stand alone workstations, 2Ghz, running WinXP with 512
> mb ram.

Well, it certainly does.  I run about 40 people off one server.  Trick is, I
don't load flash.  Now, I'm at a business, and can control this.  Flash is a
"poorly" behaved application: it essentially assumes you're one person running
on 1 machine.  So if you have 30 kids trying to watch flash movies, yeah, you
either need a machine with 30x the power of your 2 ghz machine, or you need to
spread the load around.

Which is why we developed localapps.  Offload the firefox on the thin client.

> If LTSP/Ubuntu can't manage that the students and teachers
> don't tend
> to be sympathetic. We are using google apps a lot these days, and it
> would be a bad thing for the future of LTSP at our district if we
> figured out that LTSP wasn't up to Web 2.0 or what have you.

LTSP is NOT a panacea.  A thin client will never, EVER be 100% of the
experience of a full workstation.  We've done lots of things to make LTSP as
"like" a full workstation as we can, with things like Localapps, that allows
you to offload some of the work on the thin client itself.  There's also
Stephane's ltsp-cluster work which can also address this problem.

However, the reality is, if you've got 30 kids each consuming 2ghz of
processing power playing with flash stuff, then you're either going to need the
equivalent of a 60ghz processor, or enough processors (say, 5 3ghz intel
quadcores) to come up to the same processing power.

Or, help out projects like Gnash which do the same thing for MUCH less cpu.  By
way of a "single case" instance, here's a line out of top, with me viewing a
youtube video using the adobe flash player:

2049 sbalneav  20   0  495m 120m  35m S   38  6.0   4:09.80 firefox

The "38" column's important.  That's 38% cpu usage.  This is on a dual-core
3.0ghz workstation with 2 gigs of ram.  A not inconsiderable box.  38%, over a
1/3 busy.  So, if I hosted 2 other terminals, and THEY were watching youtube,
I'd be at 100% util.

Now, Here's me watching the same video, using Totem as my movie viewer:

4208 sbalneav  20   0  201m  43m  20m S    6  2.2   0:02.41 totem

6 percent.  So, if I had 15 other terminals hanging off my box, watching
youtube videos, I'd be at 100%

3.  Versus 16.

The problem here isn't LTSP.  LTSP can't "manufacture" cpu cycles out of thin
air.  If a badly behaved application uses up all your cpu cycles, there's
nothing LTSP can do about that: it's just a way of running remote X.

> Thanks, I am defiantly looking around for Firefox optimization tricks,
> although this link is about memory issues and my problem seems to be
> CPU usage on the server. Running top on the thin clients shows me that
> I have ram to spare.

Then LocalApps may be your answer.

> As I said, my question is partly a philiopical rumination e.g I am
> really wondering why Linux/LTSP can be brought to it's knees by a
> single user running a web-browser.

Because LTSP hasn't been brought to it's knees.  The SERVER has been brought to
it's knees by flash.

It's just that, WITHOUT ltsp, you never SEE the box being brought to it's knees
because, well, while you're watching the video, you're not doing anything else.

Scott

-- 
Scott L. Balneaves | The closest you will ever come in this life to an
Systems Department | orderly universe is a good library.
Legal Aid Manitoba |     -- Ashleigh Brilliant



More information about the edubuntu-users mailing list