Battery drain caused by background updating service on Windows
Categories
(Toolkit :: Application Update, defect)
Tracking
()
People
(Reporter: simplelogin-newsletter.dl1sv, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: power)
Attachments
(1 file)
(deleted),
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0
Steps to reproduce:
- Enable the "Use a background service to install updates" option in Settings on a laptop.
- Use Firefox as normal.
Actual results:
Battery usage increases (especially in the background).
Expected results:
Battery usage shouldn't increase and/or affect battery life.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 1•2 years ago
|
||
The severity field is not set for this bug.
:mpohle, could you have a look please?
For more information, please visit auto_nag documentation.
The background update is supposed to reduce the startup time required after an update. As such it prepares stuff, which would otherwise be executed during the startup, "necessary work" if you will. While it is to be expected, that this processing takes some CPU time and drains the battery a bit by doing so, it is not supposed to have a greater impact on the battery drain than the usual startups have. I am setting the severity of this bug to S2, because the deactivation of the background updater cannot be seen as an adequate workaround for this issue, leaving us with no workaround and a pending investigation what exactly causes this issue.
:nalexander, please let me know if you agree with this estimation.
Comment 3•2 years ago
|
||
Would it be possible to set environment variables on the process that handles background updates to be able to profile what's happening there, see what it's doing, and if there are easy ways to reduce power use? I would mostly want to add the MOZ_PROFILER_STARTUP and MOZ_PROFILER_SHUTDOWN variables to the environment.
Comment 4•2 years ago
|
||
So, there's a lot going on here.
First, the OP's setting -- "Use a background service to install updates" -- is about using the Mozilla Maintenance Service, and not directly about using the background update process at all. The architecture of the MMS is that it won't be run until requested (by an update or similar processing), and the MMS really doesn't do much itself, so it's pretty unlikely that this is related to elevated background battery usage.
However, the MMS setting could enable background updates, as long as the relevant setting -- "Update while Firefox is not running" -- is enabled. That is, the MMS is required for the background update process to be scheduled. The architecture of the background update process is that we run a periodic scheduled task, generally once every 7 hours, to process updates. That task will start and exit immediately if another Firefox instance is running. But if it does run, it'll certainly have some impact on battery life -- but probably not very much beyond starting a Firefox process.
I think we'd need to understand a lot more about what time periods OP was observing, their configuration, when the background update task actually ran, etc, to get any real sense for the impact on battery life. (Again: there will be some impact, but it should be difficult to witness it, since it's intermittent and relatively small.)
Finally, to Florian's question about profiling background updates: yes, it's possible to profile background tasks generally -- we even do so in automation. But I don't see a really easy way to achieve this. First, we schedule the background update task within Firefox around https://searchfox.org/mozilla-central/rev/983c039377d4e97b381e13f4c3c1680360e6f3e2/toolkit/mozapps/update/BackgroundUpdate.jsm#280. The manual way would be to modify the created entry in the Windows Task Scheduler application (tasksched.exe
) to have the environment variables needed, but Windows doesn't allow to add or set environment variables. Therefore, we'd need to bounce between a shell that could launch with the environment variables, and all that shell quoting sounds terrible. But, probably possible. If I was doing this locally, I'd probably set these globally using the Windows interface and just launch the background update task manually, ensuring it's the only launch to see those environment variables.
Alternately: add command line argument equivalents to the MOZ_PROFILER_...
environment variables, in the same way that we have --MOZ_LOG_...
command line argument equivalents to the MOZ_LOG_...
environment variables.
In the absence of compelling evidence, I don't think this is high severity at all. There's some impact of the background update process, certainly, but we'd need a lot more evidence to suggest it's significant.
Reporter | ||
Comment 5•2 years ago
|
||
However, the MMS setting could enable background updates, as long as the relevant setting -- "Update while Firefox is not running" -- is enabled.
My bad, I forgot to mention I had this setting enabled as well and had turned it off after disabling the background service updater. It did slightly help in increasing battery life (from 1 hr to ~1 hr 10 minutes). Alternatively I had discovered my GPU settings to use my laptop's dGPU instead of selecting it when necessary, and changing it has severely improved my browsing time from 1 hour to ~3 hours even with GPU intensive tasks like web games and HD video. So, should this bug be closed since it was not entirely a Firefox issue?
Comment 6•2 years ago
|
||
(In reply to SimplySand from comment #5)
However, the MMS setting could enable background updates, as long as the relevant setting -- "Update while Firefox is not running" -- is enabled.
My bad, I forgot to mention I had this setting enabled as well and had turned it off after disabling the background service updater. It did slightly help in increasing battery life (from 1 hr to ~1 hr 10 minutes). Alternatively I had discovered my GPU settings to use my laptop's dGPU instead of selecting it when necessary, and changing it has severely improved my browsing time from 1 hour to ~3 hours even with GPU intensive tasks like web games and HD video. So, should this bug be closed since it was not entirely a Firefox issue?
GPU settings is much more plausible, yes.
Description
•