Last modified: 2013-09-02 11:53:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T54854, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 52854 - requesting large media files takes a long time (+60 seconds)
requesting large media files takes a long time (+60 seconds)
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Media storage (Other open bugs)
wmf-deployment
All All
: High normal (vote)
: ---
Assigned To: Faidon Liambotis
: performance
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-14 16:01 UTC by Jan Gerber
Modified: 2013-09-02 11:53 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jan Gerber 2013-08-14 16:01:22 UTC
I.e. this takes over a minute:

time curl -I http://upload.wikimedia.org/wikipedia/commons/2/2a/2012_State_Of_The_Union_Address_%28720p%29.ogv

HTTP/1.1 200 OK
X-Object-Meta-Sha1base36: 43zu8zc6jltx349vqqilbwt7jc0hst5
Last-Modified: Wed, 15 May 2013 23:33:27 GMT
Etag: 35befcbef1f75e1f93a975b136d365b4
X-Timestamp: 1368660807.34473
X-Content-Duration: 3901.834739229
Content-Type: application/ogg
X-Varnish: 132292977 1587556367, 3256741733
Via: 1.1 varnish, 1.1 varnish
Content-Length: 3451828359
Accept-Ranges: bytes
Date: Wed, 14 Aug 2013 15:58:52 GMT
Age: 1419806
Connection: keep-alive
X-Cache: cp1061 hit (25), cp1064 frontend miss (0)
Access-Control-Allow-Origin: *


real	1m1.593s
user	0m0.004s
sys	0m0.004s
Comment 1 Bawolff (Brian Wolff) 2013-08-14 16:36:33 UTC
Hmm, when I try getting a cached version in Varnish (with GET), it only takes about 6 seconds for the download to start. When I try for an uncached version, it waits 1 minute 10 seconds and then gives me a 503.
Comment 2 Faidon Liambotis 2013-08-22 07:57:51 UTC
I've confirmed that Swift responds instanteously, so this is probably related to Varnish streaming support -- i.e. Varnish not streaming the file as it comes from the backend, but fetching it all first then serving it from the cache. I'll have a closer look and/or poke Mark.
Comment 3 Mark Bergsma 2013-08-29 10:12:33 UTC
Fixed in https://gerrit.wikimedia.org/r/#/c/81651/

std.integer returns a signed 32 bit integer, and can wrap and become negative.
Comment 4 Jan Gerber 2013-09-02 10:12:07 UTC
is the fix deployed? still fails here now even with a timeout:

time curl -I http://upload.wikimedia.org/wikipedia/commons/2/2a/2012_State_Of_The_Union_Address_%28720p%29.ogv
HTTP/1.1 504 Gateway Time-out
Server: nginx/1.1.19
Content-Type: text/html
Content-Length: 183
Connection: keep-alive


real	1m0.157s
user	0m0.016s
sys	0m0.004s
Comment 5 Mark Bergsma 2013-09-02 10:19:00 UTC
Yes, also responds instantaneous for me. Could you please post full headers?
Comment 6 Jan Gerber 2013-09-02 11:10:36 UTC
ipv4 i get:

curl -4 -I http://upload.wikimedia.org/wikipedia/commons/2/2a/2012_State_Of_The_Union_Address_%28720p%29.ogv
HTTP/1.1 503 Service Unavailable
Server: Varnish
Content-Type: text/html; charset=utf-8
Content-Length: 3051
Accept-Ranges: bytes
Date: Mon, 02 Sep 2013 11:04:53 GMT
X-Varnish: 3458126360
Age: 58
Via: 1.1 varnish
Connection: close
X-Cache: cp3010 frontend miss (0)
Access-Control-Allow-Origin: *


real	0m58.215s
user	0m0.008s
sys	0m0.016s

ipv6:
curl -6 -I http://upload.wikimedia.org/wikipedia/commons/2/2a/2012_State_Of_The_Union_Address_%28720p%29.ogv
HTTP/1.1 504 Gateway Time-out
Server: nginx/1.1.19
Date: Mon, 02 Sep 2013 11:06:10 GMT
Content-Type: text/html
Content-Length: 183
Connection: keep-alive


real	1m0.130s
user	0m0.012s
sys	0m0.012s

host upload.wikimedia.org
upload.wikimedia.org is an alias for upload-lb.esams.wikimedia.org.
upload-lb.esams.wikimedia.org has address 91.198.174.234
upload-lb.esams.wikimedia.org has IPv6 address 2620:0:862:ed1a::b
Comment 7 Jan Gerber 2013-09-02 11:23:21 UTC
GET seams to be fast now:
curl -v http://upload.wikimedia.org/wikipedia/commons/2/2a/2012_State_Of_The_Union_Address_%28720p%29.ogv > /dev/null 

while HEAD requests (curl -I) are still slow and end in a 504:
time curl -I -v http://upload.wikimedia.org/wikipedia/commons/2/2a/2012_State_Of_The_Union_Address_%28720p%29.ogv
* About to connect() to upload.wikimedia.org port 80 (#0)
*   Trying 2620:0:862:ed1a::b...
* Connected to upload.wikimedia.org (2620:0:862:ed1a::b) port 80 (#0)
> HEAD /wikipedia/commons/2/2a/2012_State_Of_The_Union_Address_%28720p%29.ogv HTTP/1.1
> User-Agent: curl/7.29.0
> Host: upload.wikimedia.org
> Accept: */*
> 
< HTTP/1.1 504 Gateway Time-out
HTTP/1.1 504 Gateway Time-out
< Server: nginx/1.1.19
Server: nginx/1.1.19
< Date: Mon, 02 Sep 2013 11:21:10 GMT
Date: Mon, 02 Sep 2013 11:21:10 GMT
< Content-Type: text/html
Content-Type: text/html
< Content-Length: 183
Content-Length: 183
< Connection: keep-alive
Connection: keep-alive

< 
* Connection #0 to host upload.wikimedia.org left intact

real	1m0.128s
user	0m0.012s
sys	0m0.008s

that said, the video opens fast in the chrome and firefox now since since they only make GET requests with ranges.
Comment 8 Jan Gerber 2013-09-02 11:38:07 UTC
marking as fixed since the long loading times are gone and will open bug about HEAD requests if they persist.
Comment 9 Mark Bergsma 2013-09-02 11:53:07 UTC
Yeah that makes sense. Varnish converts a HEAD into a GET when doing a backend request on a miss, and then doesn't allow streaming. It'll wait until the entire object has been retrieved before generating the response.

In theory, in "streaming mode" it could do this once the response headers (for the GET) have been received, and then just not stream the body.

I'm not sure how much it's worth spending time on now though, given that Varnish 4 (slated to come out in a few months) will have a different implementation of streaming. Is this ever a problem in practice?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links