You are not logged in.

#1 2018-12-25 07:51:55

anark10n
Member
Registered: 2012-10-13
Posts: 212

[Resolved] Firefox high CPU usage when saving an image

Hey there

So, as the title says, I'm experiencing high CPU usage on Firefox 64 when saving an image, from anywhere. It wouldn't be a problem if that was all it did, but it completely locks up Firefox while it's busy. At first i thought it was only from one particular site, even though I've never had issues with that site before, but now it's any site that i go to.

Started having this issue when I updated. Any ideas as to figuring out what's causing this would be much appreciated?

Last edited by anark10n (2019-01-20 12:28:56)

Offline

#2 2018-12-25 09:14:56

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,796

Re: [Resolved] Firefox high CPU usage when saving an image

"when saving an image" is too generic of an error description:
- image or actually saving anything?
- saving from a link (still has to download) or the cache (you can already see the image in a tab)?
- save *where* (local disk, remote filesystem, …)?
- does it happen when attempting to show up the context menu, the save dialog or when actually writing the file?
- does saving take too much time? does it ultimately succeed?
- does it happen w/ running FF in safe mode? ("firefox -safe-mode") - ensure there's no pending, stale FF process

Offline

#3 2018-12-26 01:23:04

anark10n
Member
Registered: 2012-10-13
Posts: 212

Re: [Resolved] Firefox high CPU usage when saving an image

Yeah, i didn't know how to approach describing the issue, my bad.

seth wrote:

- image or actually saving anything?

Haven't tried with any other type of file. Will try and report back.

seth wrote:

- saving from a link (still has to download) or the cache (you can already see the image in a tab)?

From the cache, it it's a link, it downloads without a high CPU usage or locking up firefox.

seth wrote:

- save *where* (local disk, remote filesystem, …)?

Saving to local disk.

seth wrote:

- does it happen when attempting to show up the context menu, the save dialog or when actually writing the file?

Happens when it actually writing the file.

seth wrote:

- does saving take too much time? does it ultimately succeed?

Yes it takes longer, as i can't view the download progress until it finishes, even when i have the download window open. It does succeed in the end.

seth wrote:

- does it happen w/ running FF in safe mode? ("firefox -safe-mode") - ensure there's no pending, stale FF process

Will try this and report back.

Offline

#4 2018-12-26 09:14:36

anark10n
Member
Registered: 2012-10-13
Posts: 212

Re: [Resolved] Firefox high CPU usage when saving an image

Reporting back:

seth wrote:

- image or actually saving anything?

It's not only images. Happens when i try with MP4s and WEBMs. Strangely enough, it didn't happen with MP3s.

seth wrote:

- does it happen w/ running FF in safe mode? ("firefox -safe-mode") - ensure there's no pending, stale FF process

Experiencing the same issue in safe-mode.

Offline

#5 2018-12-26 10:44:07

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,473

Re: [Resolved] Firefox high CPU usage when saving an image


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#6 2018-12-26 17:37:44

anark10n
Member
Registered: 2012-10-13
Posts: 212

Re: [Resolved] Firefox high CPU usage when saving an image

Quite possibly, although in my case, it happens whether or not I use the keyboard or the mouse to save a file. How do i check if it's the DBUS variable to see if it's the cause of it?

Offline

#7 2018-12-26 18:33:09

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,473

Re: [Resolved] Firefox high CPU usage when saving an image

If the root cause is the same, you could try to start firefox from the terminal this way:

unset DBUS_SESSION_BUS_ADDRESS ; firefox

And check if the slowness is fixed.


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#8 2018-12-27 19:41:38

anark10n
Member
Registered: 2012-10-13
Posts: 212

Re: [Resolved] Firefox high CPU usage when saving an image

Okay so I just tried your suggestion, and no joy. Still have the same issue.

Also, unintentionally, i managed to save 2 files at the same time, and the slow down was much worse than with 1 file.

Offline

#9 2018-12-27 22:21:50

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,796

Re: [Resolved] Firefox high CPU usage when saving an image

as i can't view the download progress until it finishes, even when i have the download window open

Can you otherwise still interact w/ the firefox window(s)? (Click buttons, get a context menu, stuff lika that)
Does this also happen on the lts kernel?

Offline

#10 2018-12-28 02:38:25

davidm
Member
Registered: 2009-04-25
Posts: 371

Re: [Resolved] Firefox high CPU usage when saving an image

Are you using KDE/Plasma and do you have Baloo enabled?  Just a hunch but I've seen some weirdness with it lately where it has been "blocking" and causing (either directly or indirectly) micro-freezes for 5-60 seconds.  It seems to have to have something to do with indexing of so.  It sees the new file and then tries to index it for some reason causing the freeze.  If you have baloo you might try disabling it to test this.

Offline

#11 2018-12-29 14:33:52

anark10n
Member
Registered: 2012-10-13
Posts: 212

Re: [Resolved] Firefox high CPU usage when saving an image

seth wrote:

as i can't view the download progress until it finishes, even when i have the download window open

Can you otherwise still interact w/ the firefox window(s)? (Click buttons, get a context menu, stuff lika that)
Does this also happen on the lts kernel?

No interactions possible with Firefox until it finishes downloading. If i have the download window open, the progress bar remains frozen until the download is done.

@davidm
I'm using Openbox 3, and nemo as the file browser.

Offline

#12 2018-12-29 15:47:51

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,796

Re: [Resolved] Firefox high CPU usage when saving an image

seth wrote:

Does this also happen on the lts kernel?

Alternatively try passing "scsi_mod.use_blk_mq=0" to the kernel and ensure the cfq scheduler is used, cat /sys/block/sda/queue/scheduler (lts should afaik still default to deadline)

Offline

#13 2018-12-29 19:18:39

anark10n
Member
Registered: 2012-10-13
Posts: 212

Re: [Resolved] Firefox high CPU usage when saving an image

seth wrote:
seth wrote:

Does this also happen on the lts kernel?

Alternatively try passing "scsi_mod.use_blk_mq=0" to the kernel and ensure the cfq scheduler is used, cat /sys/block/sda/queue/scheduler (lts should afaik still default to deadline)

Having trouble getting to the desktop on the lts kernel for some reason, will report back when i get it working.
As for the alternative, this is what i get when i run it:

sysctl: cannot stat /proc/sys/scsi_mod/use_blk_mq: No such file or directory

Should i go ahead and still change the scheduler given the error?

Offline

#14 2018-12-29 21:50:05

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,796

Re: [Resolved] Firefox high CPU usage when saving an image

What's the output of

cat /sys/block/sda/queue/scheduler

?
Did you try passing the parameter at boot or at runtime?

Offline

#15 2018-12-30 21:48:44

anark10n
Member
Registered: 2012-10-13
Posts: 212

Re: [Resolved] Firefox high CPU usage when saving an image

Output of cat /sys/block/sda/queue/scheduler:

[mq-deadline] kyber bfq none

Passed the parameter at runtime.

Offline

#16 2018-12-30 22:34:20

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,796

Re: [Resolved] Firefox high CPU usage when saving an image

[qutoe]Passed the parameter at runtime.[/qutoe]
Not going to work (as you figured ;-) - sorry, should have mentioned that. You'd have to re-load scsi_mod which, if possible at all, will turn out being a PITA.

Offline

#17 2019-01-05 18:59:01

glitsj16
Member
Registered: 2015-04-26
Posts: 126

Re: [Resolved] Firefox high CPU usage when saving an image

@anark10n: do you happen to have firefox downloads preference set to "Always ask you where to save files"? I recall seeing people reporting high CPU usage like you with that (allthough I can't remember exactly where I did, probably bugzilla). Try changing that pref and see if the issue is still showing.

Offline

#18 2019-01-09 18:51:15

anark10n
Member
Registered: 2012-10-13
Posts: 212

Re: [Resolved] Firefox high CPU usage when saving an image

glitsj16 wrote:

@anark10n: do you happen to have firefox downloads preference set to "Always ask you where to save files"? I recall seeing people reporting high CPU usage like you with that (allthough I can't remember exactly where I did, probably bugzilla). Try changing that pref and see if the issue is still showing.

Yes, but there's no high cpu usage when firefox downloads an image that way. Only when I 'Ctrl+S' to save an image.
Edit: Also happens with 'Right click -> Save Page As...'

Last edited by anark10n (2019-01-09 18:54:38)

Offline

#19 2019-01-09 20:49:23

glitsj16
Member
Registered: 2015-04-26
Posts: 126

Re: [Resolved] Firefox high CPU usage when saving an image

@anark10n: Too bad that didn't help. Not the easiest issue to debug. Bugzilla is (over)loaded with 100% CPU bugs it seems... I wonder if you considered using any of the external download managers with Firefox. Plenty of options there, and allthough I realize there's no 'best for everyone' recommendation , I have been using aria2/uget for a long time with great performance/stability gains.

Related links of interest:
* https://addons.mozilla.org/en-US/firefo … ntegration
* https://addons.mozilla.org/en-US/firefo … ntegration

Offline

#20 2019-01-09 22:15:05

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,796

Re: [Resolved] Firefox high CPU usage when saving an image

Did you effectively try to go w/o the multiqueue scheduler?

Offline

#21 2019-01-10 07:09:46

anark10n
Member
Registered: 2012-10-13
Posts: 212

Re: [Resolved] Firefox high CPU usage when saving an image

seth wrote:

Did you effectively try to go w/o the multiqueue scheduler?

Still trying that, still failing to load the scsi_mod module. Will keep trying.

In the meantime, i found that the number of files in the directory may possibly be the cause of it, as saving to an empty directory, or even one with less files, Firefox saves like normal without high CPU usage. The directory i was trying to save to contains more than 11,000 files. Could this be an issue?

Offline

#22 2019-01-10 07:59:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,796

Re: [Resolved] Firefox high CPU usage when saving an image

Depending on what stupid kind of stuff the GUI dialog tries to do w/ all those files (from stat'ing every file to creating previews, even cached ones): of course.
Check whether that's a reliable pattern, but the best advice I can give you in this case is "then don't do this".

Do you get different file dialogs/paths for saving pages/images and links?

Offline

#23 2019-01-10 08:55:27

anark10n
Member
Registered: 2012-10-13
Posts: 212

Re: [Resolved] Firefox high CPU usage when saving an image

For the file type, no. For the the method i use, yes. Example, 'Ctrl+S' opens the path of the previous 'Ctrl+S', while 'Save Pages As ...' opens the previous path of 'Save Pages As ...'. For some reason.

What is stat'ing?

Offline

#24 2019-01-10 09:01:36

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,796

Re: [Resolved] Firefox high CPU usage when saving an image

stat /bin/bash
man 2 stat

Yes, I meant the approach (since the original claim was a difference between saving opened images and links to images - the question is whether this is because the dialog initially shows different paths)

Offline

#25 2019-01-15 15:23:17

mountaineerbr
Banned
Registered: 2018-12-08
Posts: 48

Re: [Resolved] Firefox high CPU usage when saving an image

Seth is much more experienced and he will not give you suggestions that are not related to no word you mentioned... What if you clear all firefox preferences in folder and see if that helps? backup your stuff. Hope you manage to solve that trouble

Offline

Board footer

Powered by FluxBB