Page MenuHomePhabricator

Mediawiki keep checks thumbnail of same size as original does exists
Open, Needs TriagePublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • This was done on every parse time. Can be checked with hook doGetFileStat() on FileBackendStore.

What happens?:
MediaWiki keep checks the thumbnail of same size as original image does exists. (Even on small 96px square image with no size sets like [[File:Image.png]])
(If it doesn't exist, normally generating thumbnails but it's same size as original so it won't generate and check original image and return it . And this does every time when parsing page.)
This is doesn't affect the performance on local disk drive with high IOPS. But if Images on low disk IOPS or Remote storage backend, this causing serious performance issue. (If parsing page that has many images over 100).

As an example, On page which has 830 images, with Extension:AWS and same region of S3 Bucket (ping to api server is took 0.4ms). It took over 70~90 seconds to complete parsing.
Making cache on Extension:AWS's doGetFileStat(), It reduces 30~50 seconds, However, It's still over 30 seconds, which is enough to Parsoid/PHP gives up with Timeout on VisualEditor.

Related issue(Extension:AWS): https://github.com/edwardspec/mediawiki-aws-s3/issues/42

What should have happened instead?:
If same size as original, just check original images instead.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:
MediaWiki 1.35.2 with Extension:AWS(Used for remote storage test)

Event Timeline

Aklapper added a subscriber: edwardspec.

Hi @MPThLee, thanks for taking the time to report this and welcome to Wikimedia Phabricator!

I don't know where the AWS extension maintainer(s) track issues and feature requests.
@edwardspec: Could you please add info where to file bug reports to https://www.mediawiki.org/wiki/Extension:AWS ? If you'd like to use Phabricator (you are very welcome to do so), then please see the docs. Thanks a lot!

Extension:AWS is on GitHub, so it uses GitHub issues as bugtracker: https://github.com/edwardspec/mediawiki-aws-s3/issues?q=is%3Aissue

This is an issue with MediaWiki core, because it's MediaWiki core that decides "when to call doGetFileStat()",
not with Extension:AWS, which provides implementation of doGetFileStat (and has no control over "when it is called").

So this makes wiki overloaded. Causing Timeout..

The whole loop of this here:

  1. Access the page or Submit/Edit a page.
  2. Core does doGetFileStat on each file and It Failed(as it won't generate at all)
  3. Core tries to generate thumbnail.
  4. So, Core loads the source image, but It's on remote storage so It will DOWNLOAD(full-file-access) every time.
  5. Thumbnail won't generate as target width/height are same as source width/height. Codes on here. (Github)
  6. It returns source image, and after edit again or HTML cache expires, Go step 1.

If the connection between Remote storage and Server is became slow, Wiki will very-long-time to render it and timeout.