Closed Bug 1350544 Opened 8 years ago Closed 4 years ago

appcache does mainthread I/O

Categories

(Core :: Networking: HTTP, defect, P3)

55 Branch
defect

Tracking

()

RESOLVED INACTIVE
Performance Impact low

People

(Reporter: Kokujou, Unassigned)

References

Details

(Keywords: perf, Whiteboard: [necko-next])

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0 Build ID: 20170324030205 Steps to reproduce: i used whatsapp web to test it. Firefox nearly freezes for a few seconds, till i can finally enter something. i tried the security mode with disabled addons, plus i disabled every browser plugin. just disabling e10 makes it faster again. my computer is more than capable of e10.
Flags: needinfo?(Kokujou)
Profiler Exception: TypeError: this._profiler.getSharedLibraryInformation is not a function
Flags: needinfo?(Kokujou)
Hi Kokujou, I tested WhatsApp.com on Windows 10 with latest nightly. But I could manage to reproduce the issue. Could you try it again the steps mentioned in comment 1 link? Thanks
Flags: needinfo?(Kokujou)
as i said before. i got an exception when using the addon. i used it and it just crashed with the reported error.
Flags: needinfo?(Kokujou)
As we wrote before, please provide Profiler data.
Flags: needinfo?(Kokujou)
@Kokujou, I got the same error using that profile addon. The document (comment 1) is now updated with the latest version of the addon. I also able to reproduce the issue, but it happens intermittently. Here is screen capture: https://testing-1.tinytake.com/sf/MTQ2MzgxNF81MTgxMzY1 Profile: https://perfht.ml/2mSYiVE
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Content Processes
Ever confirmed: true
Product: Firefox → Core
Whoaaaa - I think I'm seeing main thread disk IO here: https://perf-html.io/public/d72a2bfc2505bfdf7a2619e25cac8b237fe45910/calltree/?range=129.4271_139.5150~132.7714_137.7396&thread=0 This looks like... Necko stuff? nsOfflineCacheDevice or something? And storage? Hey jduell, know who I should point this profile at?
Flags: needinfo?(jduell.mcbugs)
Whiteboard: [qf]
This is the appcache, which we've been keeping on life-support till we can kill it. But Whatsapp and a few other major sites are still using it (including Microsoft's Office online version--see bug 1312646--and some IBM email cloud service IIRC). Honza is the only person who knows this code and he's out till Tuesday. It looks like we're getting OnDataAvailable on the main thread and doing at least two updates to the SQLite appcache database :( That said I'm puzzled that turning off e10s fixes this--I suspect there's something else going on, because I assume this same main thread I/O happens in non-e10s too. Honza, if there isn't some obvious small-ish fix to move this off-thread let's at least get some telemetry so we know how bad this winds up being on average.
Flags: needinfo?(jduell.mcbugs) → needinfo?(honzab.moz)
Summary: Firefox even slower with e10 → appcache slower with e10s on
I don't think this is e10s related. Appcache does main thread IO, always did and there is no simple fix to it. The profile shows an appcache update running which updates to the database. We could make the output stream of an appcache entry be a pipe copying the data on a stream transport thread. but that would just make a heavy concurrent access to sqlite. not a simple fix. Tho, we could think of speeding up the database. There could be done something like memory caching (provided by sqlite) or WAL journal mode. Get inspired with StorageDBThread::SetJournalMode and StorageDBThread::ConfigureWALBehavior
Flags: needinfo?(honzab.moz)
Whiteboard: [qf] → [qf:p3]
Component: DOM: Content Processes → Networking: HTTP
Summary: appcache slower with e10s on → appcache does mainthread I/O
Whiteboard: [qf:p3] → [qf:p3][necko-next]
Priority: -- → P2
Depends on: 1237782
Keywords: perf
Moving to p3 because no activity for at least 1 year(s). See https://github.com/mozilla/bug-handling/blob/master/policy/triage-bugzilla.md#how-do-you-triage for more information
Priority: P2 → P3
See Also: → 1533134
See Also: → 1580650
Depends on: 1619673

Appcache was removed.

Flags: needinfo?(Kokujou)
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INACTIVE
Performance Impact: --- → P3
Whiteboard: [qf:p3][necko-next] → [necko-next]
You need to log in before you can comment on or make changes to this bug.