Page MenuHomePhabricator

Skip Expensive MobileFormatter Transformations On Pages With Extremely High Image/Heading counts
Open, HighPublic


Per T204606, analysis was done on a subset of the Fatal error: entire web request took longer than 60 seconds errors found in logstash.

Most (but not all) of these errors were found to correlate to pages with either high image counts (> 1000) or high heading counts (> 1000). Therefore, if we want these pages to not timeout anymore, we could try skipping the MobileFormatter altogether under these scenarios.


  • Each of the cases I looked at had extremely high total element counts (> 50,000 total elements on the page). The suggested fix may remedy the majority of the timeout errors, however client side performance on mobile devices could still be pretty abysmal (e.g. slow/unuseable repaints, scroll freezing, etc). Therefore, it's probably not wise to spend a lot of time implementing this fix as it's really just a bandaid for the majority of cases.

Dev notes

Acceptance Criteria

  • When a page has > 1000 images or > 1000 headings, don't run the MobileFormatter

Event Timeline

nray created this task.Wed, Sep 11, 11:47 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptWed, Sep 11, 11:47 PM
nray updated the task description. (Show Details)Wed, Sep 11, 11:50 PM

The ParserOutput object might have some relevant information cheaply available as well, as stored while Parser ran (such as image links as pure data). That might forego the need for a regular expression. Worth checking out :)

Jdlrobson raised the priority of this task from Normal to High.Thu, Sep 12, 12:10 AM
Jdlrobson added a subscriber: Jdlrobson.

Looks ready for an estimate and discussion to me. Thanks for looking into this @nray !