Page MenuHomePhabricator

Limit maximum x-content-dimension size to avoid hitting nginx limits
Closed, DeclinedPublic

Description

Spotted this while investigating something else, now that swift uses nginx for tls termination there's a few parameters that enter into play esp. re: nginx buffering back and forth.
By default we're not buffering backend responses that nginx receives from swift (proxy_buffering) though nginx will still buffer response headers proxy_buffer_size to maximum 8k. I noticed some files (only one afaics for now) exceeds the 8k limit due to huge x-content-dimensions.

2017/06/05 12:52:41 [error] 739#739: *53704849 upstream sent too big header while reading response header from upstream, client: 10.64.16.57, server: ms-fe.svc.eqiad.wmnet, request: "GET /v1/AUTH_mw/wikipedia-commons-local-public.df/d/df/Literature_II%2C_Harutyun_Surkhatian.djvu HTTP/1.1", upstream: "http://10.64.0.38:80/v1/AUTH_mw/wikipedia-commons-local-public.df/d/df/Literature_II%2C_Harutyun_Surkhatian.djvu", host: "ms-fe.svc.eqiad.wmnet"

And indeed the full response is just a little over 8192 bytes:

$ curl -sI "http://10.64.0.38:80/v1/AUTH_mw/wikipedia-commons-local-public.df/d/df/Literature_II%2C_Harutyun_Surkhatian.djvu" | wc 
     13      35    8281

Event Timeline

Change 357895 had a related patch set uploaded (by Gilles; owner: Gilles):
[mediawiki/core@master] Remove X-Content-Dimensions header

https://gerrit.wikimedia.org/r/357895

Change 357896 had a related patch set uploaded (by Gilles; owner: Gilles):
[mediawiki/extensions/PdfHandler@master] Remove X-Content-Dimensions header

https://gerrit.wikimedia.org/r/357896

Change 357897 had a related patch set uploaded (by Gilles; owner: Gilles):
[mediawiki/extensions/PagedTiffHandler@master] Remove X-Content-Dimensions header

https://gerrit.wikimedia.org/r/357897

Change 357898 had a related patch set uploaded (by Gilles; owner: Gilles):
[mediawiki/extensions/TimedMediaHandler@master] Remove X-Content-Dimensions header

https://gerrit.wikimedia.org/r/357898

Change 357896 merged by jenkins-bot:
[mediawiki/extensions/PdfHandler@master] Remove X-Content-Dimensions header

https://gerrit.wikimedia.org/r/357896

Change 357898 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@master] Remove X-Content-Dimensions header

https://gerrit.wikimedia.org/r/357898

Change 357897 merged by jenkins-bot:
[mediawiki/extensions/PagedTiffHandler@master] Remove X-Content-Dimensions header

https://gerrit.wikimedia.org/r/357897

Change 357895 merged by jenkins-bot:
[mediawiki/core@master] Remove X-Content-Dimensions header

https://gerrit.wikimedia.org/r/357895

No header, no problem! :)