Xorg eats processor cycles while waiting for slow Internet

Bug #297143 reported by Michael Doube
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Invalid
High
Mozilla Thunderbird
New
Undecided
Unassigned
X.Org X server
Invalid
Undecided
Unassigned
xorg (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Top shows that xorg is using >40% of CPU when there's no reason for it to be doing so.

High CPU usage by xorg seems to be associated with slow/flaky Internet, e.g. slow sending of email with Thunderbird or slow loading of Launchpad in Firefox over a WiFi connection. It seems like xorg goes mental until it receives notification that the Internet transfer has completed successfully. At least Thunderbird and Firefox are involved, wget doesn't cause the same problem.

I'm using an up-to-date Hardy (64-bit) on a Sony Vaio SZ650 (intel 965 graphics) and iwlagn / iwl4965 WiFi.

Revision history for this message
Michael Doube (michael-doube) wrote :

]$ uname -a
Linux doris 2.6.24-21-generic #1 SMP Tue Oct 21 23:09:30 UTC 2008 x86_64 GNU/Linux

Revision history for this message
Michael Doube (michael-doube) wrote :
Revision history for this message
John Vivirito (gnomefreak) wrote :

not a thunderbird bug.

Changed in thunderbird:
status: New → Invalid
Revision history for this message
John Vivirito (gnomefreak) wrote :

xorg should be fine to keep bug task on.

Changed in xorg-server:
status: New → Invalid
Revision history for this message
Steve (sefurd) wrote :

same problem here, only happens when thunderbird is running....

Linux steve 2.6.27-9-generic #1 SMP Thu Nov 20 21:57:00 UTC 2008 i686 GNU/Linux
Cpu usage:
x-org = 40%
thunderbird = 40%

Thunderbird does exhibit strange behavior. The slider bar on folders(rss feeds) will not allow you to move it up or down. As soon as you try it pops back to original position. System will not resume normal operation until thunderbird is closed. Seems like it might be a thunderbird issue?

Revision history for this message
Bryce Harrington (bryce) wrote :

[This is an automated message]

Hi michael-doube,

Please attach the output of `lspci -vvnn` too.

Changed in xorg:
status: New → Incomplete
Revision history for this message
Michael Doube (michael-doube) wrote :
Revision history for this message
Bryce Harrington (bryce) wrote :

There is no evidence given why this would be an X issue. High X CPU load simply means that some client application is overdriving the x server. Feel free to reassign to X if you narrow it down to something specific to X.

Changed in thunderbird:
status: Invalid → New
Changed in xorg:
status: Incomplete → Invalid
Revision history for this message
Michael Doube (michael-doube) wrote :

Just observed this in Firefox while synchronising my Zotero database. Xorg was eating 30% of CPU while the down- and upload was running, and went back to 11% when the file transfers finished. The only moving icon that I see is the wee Zotero 'synchronising' rotating arrow.

Revision history for this message
Michael Doube (michael-doube) wrote :

And then when I upload png images to this bug report, Xorg goes mental again, eating 47-50% (i.e. one core) of CPU...

Revision history for this message
In , Michael Doube (michael-doube) wrote :

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.04 (hardy) Firefox/3.0.5
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.04 (hardy) Firefox/3.0.5

When performing an upload or download, Xorg starts eating 50% or more of my dual core CPU's cycles. This happens only with Firefox and Thunderbird; no other Internet app causes the same problem. The Firefox plugin Zotero also causes this problem when synching with the citation server. Xorg stops eating cycles as soon as Firefox or Thunderbird have finished their file transfer.
This is on 64-bit Ubuntu Hardy with Compiz enabled.

Reproducible: Always

Steps to Reproduce:
1. Get on a slightly flaky / slow connection
2. Transfer something of a few hundred kB or more

Actual Results:
3. Watch Xorg go mental by running top from the command line
4. Watch the transfer with iftop and see how as soon as the transfer finishes, Xorg's CPU usage goes back to normal.

Expected Results:
3. Xorg uses ~10% of CPU

This bug is being tracked in Launchpad:
https://bugs.launchpad.net/bugs/297143

Changed in firefox:
importance: Undecided → Unknown
status: New → Unknown
Changed in firefox:
status: Unknown → New
Revision history for this message
wesley (mrthefter) wrote :

I can confirm. My university's wireless is horrible sometimes, and this is the observed behavior.
At first, I thought it was because I was using a softmac wireless card, but a quick look at top shows Xorg being the one hogging cycles. This problem is even worse when using a compositor.
And of course, this effects all gecko related projects; thunderbird, firefox, seamonkey, etc.
Recent trunk builds exhibit the same effect.

My best guess is that gecko tries to rerender the client display every time it gets new data. As the connection is slow/unstable, data comes in at a trickle, leading it to make a lot of X calls to redraw the client. Turning off whatever loading animations I could and lowering the page redraw frequency alleviated the situation somewhat.

Revision history for this message
wesley (mrthefter) wrote :

*affects gecko related projects
Not effects. =/

Anyway, I forgot to mention, I think the bug is in gecko rendering logic, and not Xorg. I'm pretty sure Windows versions suffer the same problem, but the performance hit isn't as big as it is in X (since Windows doesn't use a client/server network model).

Revision history for this message
In , Michael Doube (michael-doube) wrote :

Xorg's CPU load is only high if some part of the Thunderbird / Firefox window is being drawn; if you run top in a terminal window 'always on top', then minimise and maximise Thunderbird while a big email is downloading you can see Xorg's CPU load going from high (50-70%) to low/normal (10-15%). You can also observe this behaviour by maximising another window in front of Thunderbird.

Revision history for this message
In , LarsWestergren (lars-westergren) wrote :

I have it also on
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10

I have a fast connection, but showing Gmail inbox takes a minute for me. There is a 1-2 second pause for rendering every "star" next to a mail, and Xorg CPU load goes up to 85%.

I use a Dell XPC with GeForce 8600M GT if that helps. I can attach lspci -vvnn if you need it.

Revision history for this message
Michael Doube (michael-doube) wrote :

This seems to be much improved in Karmic alpha 4 (Firefox 3.5.2), will keep an eye on it.

Revision history for this message
In , wesley (mrthefter) wrote :

I'm fairly sure that the compositor changes will improve this situation.
However, I don't know if it is the root cause.
Here's the bug: https://bugzilla.mozilla.org/show_bug.cgi?id=374980

Revision history for this message
In , Michael Doube (michael-doube) wrote :

Things seem to be improved in Ubuntu Karmic alpha 4, which ships Firefox 3.5.2.

Revision history for this message
In , Rpedrica (rpedrica) wrote :

I have the same issue with Slackware 13 ( kde 4.2.4 ), Firefox 3.5.2 and Thunderbird 3b4pre ( or and Thunderbird 3 ). If I have either of the two or both running, X will run with high CPU after a few hours from startup ( ie. not immediately ). This in turn slows down any plasma functions in KDE/Plasma. If I close both of FFox and TBird, then X drops to 1-5% after about a minute, which is normal. KDE plasma functions remain slow.

setup:

Slackware 13rc2 32-bit
NVidia 185.14.x
KDE 4.2.4
GSB ( Gnome Slackbuid ) 2.26.3

Revision history for this message
Michael Doube (michael-doube) wrote :

This bug is still present on Karmic while sending mail with Thunderbird version 2.0.0.23 (20090817) on a crappy hotel WiFi connection.

Revision history for this message
fontinalis (sfontinalis) wrote :

I can also confirm this. When maximizing Thundrbird from the bottom panel top shows that Xorg spikes to 50, 80, 90 percent. Switching between mail page and lightning calendar page also spikes it. Thunderbird is slow and laggy in Karmic.

uname -a
Linux i600m 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux

Revision history for this message
Jonzey (webpagelisting) wrote :

It takes exactly 10 seconds for a connection to any new web page on 9.10.
Once in a web site directory things seem slower too but I cannot confirm this.
The older version takes .2 seconds for the exact same site ( I have two hard drives).
I also installed Opera 10.0, same thing. I am running DSL at 3.0. Puppy Linux takes .18 seconds to load the pages. I know this is accurate because I have software to measure internet speed.
There is definitely a bug in 9.10 regarding connecting to a new web site and the browser is NOT the problem.
I noticed the problem immediately when I upgraded to 9.10.
I have no idea about dialup, maybe it is OK on dialup.

Revision history for this message
Michael Doube (michael-doube) wrote :

@Jonzey

Please read the whole bug report. This bug has been around since well before 9.10. I think you probably have a different bug, which you should report elsewhere.

Revision history for this message
oliver (oliver-schinagl) wrote :

Not sure if this relates to this bug or something new, but on a fresh install of karmic, whenever I open thunderbird, xorg almost grinds to a halt.

Thunderbird just needs to be open, It be doing absolutely nothing (my inbox is an IMAP box with IDLE enabled however).

Switching virtual desktops takes anywhere between 2-4 seconds! I can see redraws of any application's UI mostly and even just typing an e-mail message is slow and tedious.

Closing thunderbird makes my system return to normal operating speed.

(The same, though a little less slow, happens when running nxclient)

Both happen with compiz effects enabled and disabled, albeit when disabled it's less noticable.

Revision history for this message
Yoey (doc-wipers) wrote :

I'm experiencing exactly the same things oliver described. It even happens with a completely empty thunderbird profile.

Not sure if it has anything to do with it, but I have an ati card and am using the default video drivers.

Revision history for this message
Yoey (doc-wipers) wrote :

So I just solved this issue by installing "ATI binary X.Org driver" from Ubuntu Software Centre (for some reason drivers weren't showing up in the normal System > Administration > Hardware Drivers.

However I no longer have any desktop effects but I don't really care.

Note that even before I installed this driver, disabling desktop effects did not fix the problem.

I guess this means that the problem is something to do with the default radeon driver (I have a radeon x800) and/or some special way in which thunderbird displays.

Revision history for this message
itsjustarumour (itsjustarumour-gmail-deactivatedaccount-deactivatedaccount) wrote :

I've had this problem with xorg as long as I have been using Ubuntu (4 years).
Currently getting this problem on Lucid 10.04 Alpha3 with NVidia 195.36.03 driver.
When using a "slow" internet connection - which is 95% of the time for me as I use a Huawei E172 USB modem - xorg "eats" processor cycles, regularly going anywhere between 60-90% of CPU.

Revision history for this message
itsjustarumour (itsjustarumour-gmail-deactivatedaccount-deactivatedaccount) wrote :

PS - sorry, forgot to say, I get this when I'm browsing the web with Firefox.

Revision history for this message
Michael Doube (michael-doube) wrote :

This seems to be improved in today's Lucid ISO. Could someone with a slower connection have a go and report back?

Revision history for this message
Michael Doube (michael-doube) wrote :

Thunderbird is still doing this: set up a large account and while downloading 2 years´ worth of email Xorg uses 50% of CPU.

Revision history for this message
John Vivirito (gnomefreak) wrote :

In reply to:
https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/297143/comments/16
Opera does not use Gecko so if you are seeing same but it is not related only to Gecko. Can others please try non-gecko browsers and see if it still happens also if someone has evolution can you please test and report here. I am not convinced that this is only related to Mozilla.
I'm also not sure why this would only happen with a slow Internet connection. If it is going to eat up proc. Than it should happen with or without speed of connection.
CPU has nothing to do with connection speed

Changed in firefox:
importance: Unknown → Medium
Revision history for this message
In , Kraymer (mail-kraymer) wrote :

I'm still seeing it with recent versions of both programs. It's especially noticable with sending emails with large attachments over a slow connection in TB.

Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Thunderbird/3.1.7

and Firefox 4.0b11 on the same platform

Revision history for this message
skhawam (s-khawam) wrote :

I get similar 12% CPU utilization from both Xorg and thunderbird/firefox. I'm using Ubuntu 11.04, Thunderbird/3.1.10.
In Thunderbird the problem doesn't happen from the progress bar (which I guess is GTK Theme dependent) but from the rotating 'hourglass' in the top-left corner at the top of the 'Inbox' tab. Not sure either what this waiting signal is supposed to do, at it seems to get stuck waiting randomly on some selected type of messages.

Revision history for this message
In , Hskupin (hskupin) wrote :

Interesting that this bug is still marked as unconfirmed. I can clearly see it myself on my laptop running Ubuntu 14.04. It's not that clear to me yet when it directly starts but it might have something to do with hibernation. When it occurs the CPU load of Xorg and compiz is raising up to 60% and stays at this level until the application gets closed. In my case it is mostly Thunderbird.

I have updated to Ubuntu 14.10 now, and will closely watch this problem over the next couple of days to maybe find a pattern to reproduce.

Changed in firefox:
status: New → Confirmed
Revision history for this message
In , kekkyojin (leofigueres) wrote :

I have been CC'd here. Now I am just wondering why :/ :\

Revision history for this message
In , Vseerror (vseerror) wrote :

(In reply to Javi Rueda from comment #8)
> I have been CC'd here. Now I am just wondering why :/ :\

I guess ... does this happen with normal speed network? I.E. does this really only happen with a slow network?

Revision history for this message
In , Vseerror (vseerror) wrote :

Do you see it with current version 50?

(In reply to mrthefter from comment #3)
> I'm fairly sure that the compositor changes will improve this situation ... bug 374980

This is clearly unlikely to happen.

Revision history for this message
In , Hskupin (hskupin) wrote :

I don't use Linux anymore so I cannot respond to the question.

Changed in firefox:
importance: Medium → High
Revision history for this message
In , Mozilla-org-0 (mozilla-org-0) wrote :

I don't see this issue on FF 51, Linux Mint 18 KDE edition.

Revision history for this message
In , Foss-9 (foss-9) wrote :

No longer a Linux user. At least one that could be helpful here, as my one Linux machine is too much old and basic.

Revision history for this message
In , Vseerror (vseerror) wrote :

WFM per comment 12

Changed in firefox:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.