Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 229c0a0

Browse files
Merge pull request magento#1225 from jeff-matthews/jm_1202_adjust_http_resp_size
Adjust the Varnish HTTP response size
2 parents c84c109 + 25c8dd5 commit 229c0a0

File tree

2 files changed

+31
-9
lines changed

2 files changed

+31
-9
lines changed

guides/v2.0/config-guide/varnish/tshoot-varnish-503.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@ version: 2.0
1010
github_link: config-guide/varnish/tshoot-varnish-503.md
1111
---
1212

13-
If the length of {% glossarytooltip 0bc9c8bc-de1a-4a06-9c99-a89a29c30645 %}cache{% endglossarytooltip %} tags used by Magento exceed Varnish's default of 8192 characters, you can see HTTP 503 (Backend Fetch Failed) errors in the browser. The errors might display similar to the following:
13+
If the length of {% glossarytooltip 0bc9c8bc-de1a-4a06-9c99-a89a29c30645 %}cache{% endglossarytooltip %} tags used by Magento exceed Varnish's default (8K), you can see HTTP 503 (Backend Fetch Failed) errors in the browser. The errors might display similar to the following:
1414

1515
Error 503 Backend fetch failed
1616
Backend fetch failed
1717

18-
To resolve this issue, increase the default value of `http_resp_hdr_len` in your Varnish configuration file as follows:
18+
To resolve this issue, increase the default value of the `http_resp_hdr_len` parameter in your Varnish configuration file. The `http_resp_hdr_len` parameter specifies the max header length _within_ the total default response size (32K).
19+
20+
<div class="bs-callout bs-callout-info" id="info">
21+
<span class="glyphicon-class">
22+
<p>If the <code>http_resp_hdr_len</code> value exceeds 32K, you must also increase the default response size using the <code>http_resp_size</code> parameter.</p></span>
23+
</div>
1924

2025
1. As a user with `root` privileges, open your Vanish configuration file in a text editor:
2126

@@ -25,13 +30,17 @@ To resolve this issue, increase the default value of `http_resp_hdr_len` in your
2530

2631
2. Search for the `http_resp_hdr_len` parameter.
2732
3. If the parameter doesn't exist, add it after `thread_pool_max`.
28-
4. Set `http_resp_hdr_len` to a value equal to the product count of your largest {% glossarytooltip 50e49338-1e6c-4473-8527-9e401d67ea2b %}category{% endglossarytooltip %} multiplied by 30. (Each product tag is about 21 characters in length.)
33+
4. Set `http_resp_hdr_len` to a value equal to the product count of your largest {% glossarytooltip 50e49338-1e6c-4473-8527-9e401d67ea2b %}category{% endglossarytooltip %} multiplied by 21. (Each product tag is about 21 characters in length.)
34+
35+
For example, setting the value to 64000 should work if your largest category has 3,000 products:
2936

30-
For example, setting the value to 64000 should work if your largest category has 3,050 products.
37+
-p http_resp_hdr_len=64000 \
38+
39+
5. Set the `http_resp_size` to a value that accommodates the increased response header length.
3140

3241
For example:
3342

34-
-p http_resp_hdr_len=64000 \
43+
-p http_resp_size=65536 \
3544

3645
A snippet follows:
3746

@@ -42,5 +51,6 @@ To resolve this issue, increase the default value of `http_resp_hdr_len` in your
4251
-p thread_pool_min=${VARNISH_MIN_THREADS} \
4352
-p thread_pool_max=${VARNISH_MAX_THREADS} \
4453
-p http_resp_hdr_len=64000 \
54+
-p http_resp_size=65536 \
4555
-S ${VARNISH_SECRET_FILE} \
4656
-s ${VARNISH_STORAGE}"

guides/v2.2/config-guide/varnish/tshoot-varnish-503.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,17 @@ github_link: config-guide/varnish/tshoot-varnish-503.md
1212

1313
## Backend Fetch Failed errors
1414

15-
If the length of {% glossarytooltip 0bc9c8bc-de1a-4a06-9c99-a89a29c30645 %}cache{% endglossarytooltip %} tags used by Magento exceed Varnish's default of 8192 characters, you can see HTTP 503 (Backend Fetch Failed) errors in the browser. The errors might display similar to the following:
15+
If the length of {% glossarytooltip 0bc9c8bc-de1a-4a06-9c99-a89a29c30645 %}cache{% endglossarytooltip %} tags used by Magento exceed Varnish's default (8K), you can see HTTP 503 (Backend Fetch Failed) errors in the browser. The errors might display similar to the following:
1616

1717
Error 503 Backend fetch failed
1818
Backend fetch failed
1919

20-
To resolve this issue, increase the default value of `http_resp_hdr_len` in your Varnish configuration file as follows:
20+
To resolve this issue, increase the default value of the `http_resp_hdr_len` parameter in your Varnish configuration file. The `http_resp_hdr_len` parameter specifies the max header length _within_ the total default response size (32K).
21+
22+
<div class="bs-callout bs-callout-info" id="info">
23+
<span class="glyphicon-class">
24+
<p>If the `http_resp_hdr_len` value exceeds 32K, you must also increase the default response size using the `http_resp_size` parameter.</p></span>
25+
</div>
2126

2227
1. As a user with `root` privileges, open your Vanish configuration file in a text editor:
2328

@@ -27,14 +32,20 @@ To resolve this issue, increase the default value of `http_resp_hdr_len` in your
2732

2833
2. Search for the `http_resp_hdr_len` parameter.
2934
3. If the parameter doesn't exist, add it after `thread_pool_max`.
30-
4. Set `http_resp_hdr_len` to a value equal to the product count of your largest {% glossarytooltip 50e49338-1e6c-4473-8527-9e401d67ea2b %}category{% endglossarytooltip %} multiplied by 30. (Each product tag is about 21 characters in length.)
35+
4. Set `http_resp_hdr_len` to a value equal to the product count of your largest {% glossarytooltip 50e49338-1e6c-4473-8527-9e401d67ea2b %}category{% endglossarytooltip %} multiplied by 21. (Each product tag is about 21 characters in length.)
3136

32-
For example, setting the value to 64000 should work if your largest category has 3,050 products.
37+
For example, setting the value to 64000 should work if your largest category has 3,000 products.
3338

3439
For example:
3540

3641
-p http_resp_hdr_len=64000 \
3742

43+
5. Set the `http_resp_size` to a value that accommodates the increased response header length.
44+
45+
For example:
46+
47+
-p http_resp_size=65536 \
48+
3849
A snippet follows:
3950

4051
# DAEMON_OPTS is used by the init script.
@@ -44,6 +55,7 @@ To resolve this issue, increase the default value of `http_resp_hdr_len` in your
4455
-p thread_pool_min=${VARNISH_MIN_THREADS} \
4556
-p thread_pool_max=${VARNISH_MAX_THREADS} \
4657
-p http_resp_hdr_len=64000 \
58+
-p http_resp_size=65536 \
4759
-S ${VARNISH_SECRET_FILE} \
4860
-s ${VARNISH_STORAGE}"
4961

0 commit comments

Comments
 (0)