You are browsing a read-only backup copy of Wikitech. The live site can be found at


From Wikitech-static
Revision as of 08:51, 13 October 2016 by imported>Filippo Giunchedi (add Debian package instructions)
Jump to navigation Jump to search

There is an ongoing effort to rewrite our production thumbnailing infrastructure around Thumbor servers. The objective is to ultimately stop storing thumbnails in Swift, to remove the need to run mediawiki on image scalers and to generally have a more maintainable platform.

This new Thumbor service is meant to be stateless and only concern itself with transforming images.

Currently the new Thumbor-based stack is being developed on Vagrant. Also deployed in production in eqiad (thumbor1001.eqiad.wmnet, thumbor1002.eqiad.wmnet), fetching originals from swift and storing thumbnails back into swift with the thumbor/ prefix.

After that, we will need to figure out a replacement for Swift, in all likelihood an LRU cache that will run on its own cluster and won't store more than one copy of each thumbnail. Thumbor will be pointed to that instead of Swift to store thumbnails and we can decommission the storage of thumbnails in Swift.

File types

Adapters for all the file formats used on Commons have been written for Thumbor (JPG, PNG, GIF, TIFF, XCF, SVG, PDF, DJVU, WEBM, OGV).


Thumbor reads its originals directly from Swift and only caches them in memory for the duration of the thumbnail's request, in case a concurrent request on the same Thumbor server wants the same original (which is particularly useful in prerendering/warming situations). After the request is done, it doesn't keep any copy of the original anywhere.


Thumbor stores thumbnails on Swift, using the same location scheme as image scalers. It doesn't cache nor store thumbnails locally.


Thumbor is currently stateless and doesn't need to concern itself with purges.


Debian package

Thumbor is deployed via Debian packages, specifically python-thumbor-wikimedia contains WMF extensions to process additional file types, talk to swift and so on. The repository with debian/ directory lives at operations/debs/python-thumbor-wikimedia while "upstream" repository is at

Assuming debian/changelog has been updated, it is possible to build a new package by first tagging upstream/VERSION the relevant commit and then git-buildpackage -us -uc -S to create a .orig.tar.gz and dpkg-source -b . to create the source package. Once the source package is available it can be built with BACKPORTS=yes DIST=jessie-wikimedia sudo -E cowbuilder --debbuildopts -sa --build DSC_FILE and uploaded to