{"id":27405,"date":"2020-06-27T20:13:20","date_gmt":"2020-06-27T18:13:20","guid":{"rendered":"https:\/\/pi3g.com\/?p=27405"},"modified":"2020-06-27T20:13:20","modified_gmt":"2020-06-27T18:13:20","slug":"envoy-fix-for-serving-big-files-from-the-backend-timeouts-aborted-downloads","status":"publish","type":"post","link":"https:\/\/pi3g.com\/de\/envoy-fix-for-serving-big-files-from-the-backend-timeouts-aborted-downloads\/","title":{"rendered":"envoy Fix f\u00fcr das Ausliefern gro\u00dfer Dateien aus dem Backend \/ Timeouts \/ abgebrochene Downloads"},"content":{"rendered":"<p>Customers were complaining about not being able to download big files from our websites (e.g. PiDoctor on PiCockpit.com). <\/p>\n<p>Initially I could not replicate the issue locally, the files seemed to be downloading fine.<\/p>\n<p>After further investigation I determined that the downloads were cutting out after a certain time \u2013 depending on your download speed, thus, for some customers the downloads would fail.<\/p>\n<p>Because I have a reasonably fast connection, for me the downloads would work. <\/p>\n<p>The timeout turns out to be <strong>15 seconds<\/strong>.<\/p>\n<p>A debug message from envoy might look something like this:<\/p>\n<p><b>penvoyage-athena-envoy | [2020-06-27 16:18:57.492][21][debug][router] [source\/common\/router\/router.cc:681] [C37][S12388594366303232323] upstream timeout<\/b><\/p>\n<p><strong><\/strong><b><br \/><\/b><\/p>\n<p>Further investigation with the Envoy documentation showed that, indeed, there was such a default timeout:<\/p>\n<p><a href=\"https:\/\/pi3g.com\/wp-content\/uploads\/2020\/06\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"875\" height=\"193\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/pi3g.com\/wp-content\/uploads\/2020\/06\/image_thumb-3.png\" border=\"0\"><\/a><\/p>\n<p>Therefore the timeout needs to be set to 0s for the respective route:<\/p>\n<p><a href=\"https:\/\/pi3g.com\/wp-content\/uploads\/2020\/06\/image-4.png\"><img loading=\"lazy\" decoding=\"async\" width=\"244\" height=\"75\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/pi3g.com\/wp-content\/uploads\/2020\/06\/image_thumb-4.png\" border=\"0\"><\/a><\/p>\n<p>or one with more context:<\/p>\n<p><a href=\"https:\/\/pi3g.com\/wp-content\/uploads\/2020\/06\/image-5.png\"><img loading=\"lazy\" decoding=\"async\" width=\"611\" height=\"538\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/pi3g.com\/wp-content\/uploads\/2020\/06\/image_thumb-5.png\" border=\"0\"><\/a><\/p>\n<p>in clear text:<\/p>\n<blockquote>\n<p>route_config:<br \/>&nbsp;&nbsp; virtual_hosts:<br \/>&nbsp;&nbsp; &#8211; name: backend<br \/>&nbsp;&nbsp;&nbsp;&nbsp; domains: [&#8220;*&#8221;]<br \/>&nbsp;&nbsp;&nbsp;&nbsp; routes:<br \/>&nbsp;&nbsp;&nbsp;&nbsp; &#8211; match: { prefix: &#8220;\/.well-known\/acme-challenge\/&#8221;}<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route: <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cluster: target_certbot<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>timeout: 0s<\/strong>\n<\/p>\n<\/blockquote>\n<p>Set this per route timeout to allow big downloads without timeouts. Keep your customers happy, and they will keep you happy.<\/p>\n<h1>Ref<\/h1>\n<ul>\n<li><a href=\"https:\/\/www.envoyproxy.io\/docs\/envoy\/latest\/faq\/configuration\/timeouts\">Envoy FAQ timeouts<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Kunden haben sich dar\u00fcber beschwert, dass sie gro\u00dfe Dateien von unseren Websites (z.B. PiDoctor auf PiCockpit.com) nicht herunterladen konnten. Zun\u00e4chst konnte ich das Problem nicht lokal replizieren, die Dateien schienen problemlos heruntergeladen zu werden. Nach weiteren Untersuchungen stellte ich fest, dass die Downloads nach einer bestimmten Zeit abbrachen - abh\u00e4ngig von der Downloadgeschwindigkeit...<\/p>","protected":false},"author":830,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[402],"tags":[816,815,813,811,814,481,810,489,709,812],"class_list":["post-27405","post","type-post","status-publish","format-standard","hentry","category-development","tag-15-seconds","tag-15s","tag-aborted-download","tag-big-file","tag-cuts","tag-envoy","tag-envoy-proxy","tag-envoy-yaml","tag-timeout","tag-upstream-timeout"],"_links":{"self":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts\/27405","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/users\/830"}],"replies":[{"embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/comments?post=27405"}],"version-history":[{"count":1,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts\/27405\/revisions"}],"predecessor-version":[{"id":27406,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts\/27405\/revisions\/27406"}],"wp:attachment":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/media?parent=27405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/categories?post=27405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/tags?post=27405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}