Closed
Bug 890154
Opened 11 years ago
Closed 9 years ago
[system] Power consumption increases when using Facebook application.
Categories
(Firefox OS Graveyard :: Performance, enhancement, P4)
Tracking
(Not tracked)
RESOLVED
FIXED
FxOS-S10 (30Oct)
People
(Reporter: leo.bugzilla.gaia, Unassigned)
References
Details
(Keywords: perf, Whiteboard: [c=power p= s= u=] [3rd Party][TD-9540][apps watch list1][Power])
Attachments
(2 files)
Precondition:
1. Enable 3G data or WiFi connection.
STR:
1. Launch "facebook" application and login and check the power consumption.
2. Logout of facebook and check the power consumption.
Actual:
High current usage is noticed:
3G: Average Current 14.29 mA / Sleep Current 1.53mA
WiFi: Average Current 92.85mA / Sleep Current 1.61mA
Expected:
The current consumption should be at average values.
Flags: needinfo?(jsmith)
Comment 2•11 years ago
|
||
mlee, are you aware of power requirements here? It's unclear if the WiFi avg current is alarming.
Flags: needinfo?(mlee)
Comment 3•11 years ago
|
||
Alex, there're no power perf requirements for 1.1 (leo). 1.2 will be our first opportunity to define, track and make fixes against those. Sandip, cc'd may have more info to share on product/partner goals.
Comment 4•11 years ago
|
||
Correct, We do not have app specific numbers. However I am not clear what the ask is here. Is the problem here that facebook app draws more current than other apps? (on 3G or wifi)? Note that Wifi and 3g current draws themselves are different irrespective of apps. Leo: Can you elaborate?
(In reply to Sandip Kamat from comment #4)
> However I am not clear what the ask is here. Is the problem here that facebook
> app draws more current than other apps? (on 3G or wifi)?
We are observing a high consumption of current while using facebook application over wifi.
Updated•11 years ago
|
Assignee: nobody → hkirschner
Whiteboard: [3rd Party][TD-9540] [c= ] → [3rd Party][TD-9540] [c= ][apps watch list1]
Comment 6•11 years ago
|
||
Leo will provide more analytic data to see if this is an app or wifi problem.
Comment 7•11 years ago
|
||
Needinfo'ing Leo to help with comment# 6.
Flags: needinfo?(leo.bugzilla.gecko)
Comment 8•11 years ago
|
||
Wrote too fast..also wanted to make sure comment# 3 is read and this may be blocking only if its a regression with STR
Updated•11 years ago
|
Status: NEW → ASSIGNED
I am sharing more analysis values captured for different application.
3G values
Facebook: Average current 159.8mA/Sleep current 48.5mA
Twitter: Average current 109.3mA/Sleep current 22.6mA
Browser: Average current 106.4mA/Sleep current 6.5mA
Wifi Values
Facebook: Average current 113.8mA/Sleep current 11.7mA
Twitter: Average current 88.7mA/Sleep current 12.2mA
Browser: Average current 119.47mA/Sleep current 9.2mA
The average values calculated for a period of 3 minutes. Hope these data will be helpful.
Flags: needinfo?(leo.bugzilla.gecko)
Comment 10•11 years ago
|
||
Triage - per comment 9 the problem seems to be with facebook application and not the device/build itself.
Leo considers this non-blocking for the release as the application is developed by facebook and out of Mozilla control. However, please follow up with facebook on this investigation.
Hi Karen, can you reach out to facebook on this?
Thanks.
blocking-b2g: leo? → ---
Flags: needinfo?(kward)
Updated•11 years ago
|
Whiteboard: [3rd Party][TD-9540] [c= ][apps watch list1] → [3rd Party][TD-9540][apps watch list1] [c=battery p=]
Reporter | ||
Comment 11•11 years ago
|
||
Is there any update? leo have QE issue about this. Please let me know the current status.
Flags: needinfo?(wchang)
Updated•11 years ago
|
Whiteboard: [3rd Party][TD-9540][apps watch list1] [c=battery p=] → [3rd Party][TD-9540][apps watch list1] [c=power p=]
Updated•11 years ago
|
Blocks: b2g-facebook
Flags: needinfo?(kward)
Updated•11 years ago
|
Priority: -- → P1
Comment 12•11 years ago
|
||
I am hesitant to tell a partner that his apps needs to much power on our device. Especially without much detail into the "why" and when the app has a lot of functionality and connectivity like FB.
Mike, who would be the right person to look into this and provide some starting point for further investigation?
Flags: needinfo?(mlee)
Comment 13•11 years ago
|
||
Harald,
Our team (FxOS Performance) is building hardware and software harnesses for measuring power usage on FxOS. Jon has built a few prototypes but not enough to send you one for testing Facebook's power draw yourself. Dave Huseby is working on getting the software automation pieces in place.
Jon or Dave,
How soon can we use the power harness you're creating to measure power usage for apps like Facebook? Is it possible to use what we have to give Harald some starting point for his investigation?
Flags: needinfo?(mlee)
Flags: needinfo?(jhylands)
Flags: needinfo?(dhuseby)
Whiteboard: [3rd Party][TD-9540][apps watch list1] [c=power p=] → [3rd Party][TD-9540][apps watch list1] [c=power p= s= u=]
Comment 14•11 years ago
|
||
Dave has the harness, so he's going to have to run with this. Once I get the printer, I can easily create another one for myself.
Flags: needinfo?(jhylands)
Comment 15•11 years ago
|
||
how is this issue going?
Updated•11 years ago
|
Severity: major → enhancement
Priority: P1 → P4
Comment 16•11 years ago
|
||
We're getting close to being able to take great power data. I'm adding the blocker that this is waiting on.
Depends on: 924607
Flags: needinfo?(dhuseby)
Updated•11 years ago
|
Flags: needinfo?(wchang)
Comment 17•11 years ago
|
||
We will get back to FB when we have better data. Until then assigning to Jason to find a better component.
Assignee: hkirschner → jsmith
Comment 18•11 years ago
|
||
I'm going to leave this in the general component for now. I'll work with the perf team when the power consumption tools are available to analyze this.
Assignee: jsmith → nobody
No longer blocks: b2g-facebook
Comment 19•11 years ago
|
||
via DANIEL JESUS COLOMA BAIGES
We are having some issues during the IOT Test of the 1.3 Devices to be launched. The scenario is open FB app (https://marketplace.firefox.com/app/facebook-1) as well as some other apps (e.g. Line) and switching the screen off. The behaviour we have seen is that the CPU is always awake and all the apps are active and hence the battery drains.
The app that seems to keep CPU awake is the FB one by keeping an open socket that receive information every 40 secs (and responding through that socket too).
When FB App starts:
$ tail -f netstats.txt
tcp 0 0 0.0.0.0:666 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:2828 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5037 0.0.0.0:* LISTEN
tcp 0 0 10.2.205.137:60636 195.57.152.67:443 ESTABLISHED
tcp 0 0 10.2.205.137:60635 195.57.152.67:443 ESTABLISHED
tcp 0 0 10.2.205.137:37080 69.171.235.16:443 ESTABLISHED
tcp 0 0 10.2.205.137:60640 195.57.152.67:443 ESTABLISHED
tcp 0 0 10.2.205.137:37397 195.57.152.171:443 ESTABLISHED
tcp 0 0 10.2.205.137:53711 31.13.80.81:443 ESTABLISHED
tcp 0 0 10.2.205.137:60637 195.57.152.67:443 ESTABLISHED
After a while (5 minutes)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:666 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:2828 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5037 0.0.0.0:* LISTEN
tcp 0 0 10.2.205.137:37080 69.171.235.16:443 ESTABLISHED
tcp 0 0 10.2.205.137:53711 31.13.80.81:443 ESTABLISHED
So it seems FB apps keeps two sockets open to channelproxy-shv-13-prn1.facebook.com and edge-z-1-shv-01-cdg1.facebook.com.
This is reducing battery life a lot and there is no benefit for the end-user as FB app is not popping up any notification (even when the device screen is off), so any information received in the background will not be shown until the user move FB app to the foreground again.
Comment 20•11 years ago
|
||
Colby, do you have ideas on how to fix this battery drain?
I would think closing and re-opening the websocket when the the visibilitychange is fired. Another option is to just idle a bit more and reduce the amount of messages during the hidden state.
Flags: needinfo?(colby)
Comment 22•11 years ago
|
||
Hmm yeah that's no good. I think killing the connection on visibilitychange makes sense. I'll check with the folks who maintain the socket stuff and see what they think.
Thanks for the heads up Harald.
Flags: needinfo?(colby)
Comment 23•11 years ago
|
||
The problem is not as much the connections being kept open (which by itself doesn't consume any CPU/battery) but that the server is sending data through that connections every 40 seconds (and this was on my own account, which isn't precisely what I would call very active).
So every 40 seconds the CPU awakes, process whatever Facebook's server is sending (and incidentally every other process that was waiting for CPU also gets CPU time) and then tries to go back to sleep. What's worse, I don't think we even have time to put the radio into power saving mode (since it's being activated every 40 seconds).
The attached file is a summary of a tcpdump running on the phone (with only FB app running) and the filter:
ip.src == 69.171.235.16 or ip.dst==69.171.235.16
The time shown are relative times to the last filtered package (in other words, they're interval between consecutive packages on the attached log).
Comment 24•11 years ago
|
||
Colby, I also head on this issue in my project, FB drains a 60mA average current which is horrible for battery life. Waiting update from your side...
Updated•11 years ago
|
Component: General → Performance
Whiteboard: [3rd Party][TD-9540][apps watch list1] [c=power p= s= u=] → [c=power p= s= u=] [3rd Party][TD-9540][apps watch list1]
Comment 25•11 years ago
|
||
I did some testing of this today, and was unable to reproduce the results. The Facebook app was taking on average about 15mA more than just the homescreen by itself (both with the screen visible), and I didn't see any cycling of power usage on clearly defined boundaries (like 40-45 seconds).
Note that I was running a dev build of 2.0 on a Hamachi for this test.
Comment 26•11 years ago
|
||
The team that owns server polling is working on a way to disable polling on visibilitychange. I'll keep you all posted once we have a fix.
Comment 27•11 years ago
|
||
(In reply to Colby Rabideau from comment #26)
> The team that owns server polling is working on a way to disable polling on
> visibilitychange. I'll keep you all posted once we have a fix.
Thanks for the update, do you an ETA for the fix? It is important for us in order to schedule next battery test round.
Flags: needinfo?(colby)
Hi Colby -
Also is it possible to provide an engineering release for us to verify first? We want to make sure that the power consumption of the device can indeed improved once the FB modify the polling mechanism. It would be best if we can have a test build of FB before end of Wednesday(May 7).
Appreciate your help
Comment 29•11 years ago
|
||
vchen: FB is hosted so there are no "builds" per se. But if you send Colby your FB email he might be able to get you on the beta pool (if I remember correctly from the meeting, no promises). I also wouldn't put much priority on that, as looking at the feedback we collected there is a high chance that killing websockets will fix the battery issue. We don't have any attack vector so far.
Is there any other debugging FB or Mozillas Partner Engineering could do to verify a fix. I imagine running the profiler using the App Manager and seeing how many cycles still happens when the phone is put so sleep?
Flags: needinfo?(vchen)
(In reply to Harald Kirschner :digitarald from comment #29)
> vchen: FB is hosted so there are no "builds" per se. But if you send Colby
> your FB email he might be able to get you on the beta pool (if I remember
> correctly from the meeting, no promises). I also wouldn't put much priority
> on that, as looking at the feedback we collected there is a high chance that
> killing websockets will fix the battery issue. We don't have any attack
> vector so far.
>
> Is there any other debugging FB or Mozillas Partner Engineering could do to
> verify a fix. I imagine running the profiler using the App Manager and
> seeing how many cycles still happens when the phone is put so sleep?
Hi Harald -
i see...thanks for the feedback. I think your verification approach is solid, if we can have a comparison between a) with current FB, how many cycles still happens when the phone is put to sleep for 20 minutes. and b) with modified FB, how many cycles still happens when the phone is put to sleep for 20 minutes.
If our partner can have this data, they can do the math and estimate what the power consumption gain will be from the FB modification.
How do you think?
Flags: needinfo?(vchen) → needinfo?(hkirschner)
Comment 31•11 years ago
|
||
Hey guys, I've got a quick update from our end:
The team working on this won't able to get the fix in for next week's release. They're expecting to have to code ready sometime next week, to be released the following Tuesday (5/20).
We're proceeding cautiously here because the change will affect a core piece the msite infrastructure.
I'll keep you posted as updates are available and look into using the App Manager profiler once we have a fix to test.
Flags: needinfo?(colby)
Updated•11 years ago
|
Flags: needinfo?(hkirschner)
Comment 32•11 years ago
|
||
Hi Colby,
Can you confirm if this has been already released?
Thanks a lot!
David
(In reply to Colby Rabideau from comment #31)
> Hey guys, I've got a quick update from our end:
>
> The team working on this won't able to get the fix in for next week's
> release. They're expecting to have to code ready sometime next week, to be
> released the following Tuesday (5/20).
>
> We're proceeding cautiously here because the change will affect a core piece
> the msite infrastructure.
>
> I'll keep you posted as updates are available and look into using the App
> Manager profiler once we have a fix to test.
Comment 33•11 years ago
|
||
Hey David, I just checked with the team, and unfortunately they weren't able to get the fix into this week's release. Hopefully, next week. I'll circle back with them on Thursday/Friday, and let you guys know how it's coming.
Comment 34•11 years ago
|
||
Hi Colby,
Thanks for the update. Please, take into account that this is a blocking issue for launching in Spain.
Let me know if we could help here...
Thanks!
David
Comment 35•11 years ago
|
||
Hi Colby,
Do you have any update on this? Do you have an ETA for the new release?
Thanks a lot!
David
Flags: needinfo?(colby)
Comment 36•11 years ago
|
||
Hey David, the patch to pause server polling on visibility change went out this afternoon!
Flags: needinfo?(colby)
Comment 37•11 years ago
|
||
Thanks a lot Colby!
We've been reported that battery measurements now are better and acceptable :)
Again, thanks for all your help!
David
Comment 38•11 years ago
|
||
Awesome! Glad to help!
Updated•9 years ago
|
Whiteboard: [c=power p= s= u=] [3rd Party][TD-9540][apps watch list1] → [c=power p= s= u=] [3rd Party][TD-9540][apps watch list1][Power]
Comment 40•9 years ago
|
||
> We've been reported that battery measurements now are better and acceptable :)
Can we close this bug, then? Thanks.
Flags: needinfo?(dpalomino.bugzilla)
Comment 41•9 years ago
|
||
Hi,
Thanks for checking this. Closing the bug.
Cheers,
David
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(dpalomino.bugzilla)
Resolution: --- → FIXED
Updated•9 years ago
|
Target Milestone: --- → FxOS-S10 (30Oct)
You need to log in
before you can comment on or make changes to this bug.
Description
•