1
votes

I'm trying to install and configure varnish in mey srever, and I think I've done it, altought when I run the teste i get:

curl -I http://localhost

HTTP/1.1 503 Backend fetch failed Date: Mon, 26 Aug 2019 17:16:50 GMT Server: Varnish Content-Type: text/html; charset=utf-8 Retry-After: 5 X-Varnish: 32770 Age: 0 Via: 1.1 varnish (Varnish/5.2) Connection: keep-alive

Can any expert help me? For what i see i get this problem "HTTP/1.1 503 Backend fetch failed", I've already locate more memory but the problem persists...

Best regards, Leonel Nunes

3

3 Answers

1
votes
  • BereqProtocol HTTP/1.0
  • BereqHeader Host: www.test.com
  • BereqHeader X-Forwarded-For: 145.239.78.207
  • BereqHeader grace: none
  • BereqHeader X-Varnish: 30
  • VCL_call BACKEND_FETCH
  • VCL_return fetch
  • BackendOpen 29 boot.default 145.239.78.207 8080 145.239.78.207 56942
  • BackendStart 145.239.78.207 8080
  • Timestamp Bereq: 1568108230.028067 0.000121 0.000121
  • BerespProtocol HTTP/1.0
  • Timestamp Beresp: 1568108230.030388 0.002443 0.002321
  • BerespProtocol HTTP/1.0
  • BerespStatus 200
  • BerespReason OK
  • BerespHeader Date: Tue, 10 Sep 2019 09:37:10 GMT
  • BerespHeader Server: Apache
  • BerespHeader Last-Modified: Fri, 23 Aug 2019 01:46:14 GMT
  • BerespHeader Accept-Ranges: bytes
  • BerespHeader Content-Length: 7725
  • BerespHeader Cache-Control: max-age=31536000
  • BerespHeader Expires: Wed, 09 Sep 2020 09:37:10 GMT
  • BerespHeader X-Frame-Options: SAMEORIGIN
  • BerespHeader Connection: close
  • BerespHeader Content-Type: image/jpeg
  • VCL_call BACKEND_RESPONSE
  • TTL VCL -1 259200 0 1568108230
  • TTL VCL 120 259200 0 1568108230
  • VCL_return deliver
  • Storage malloc Transient
  • ObjProtocol HTTP/1.0
  • ObjStatus 200
  • ObjReason OK
  • ObjHeader Date: Tue, 10 Sep 2019 09:37:10 GMT
  • ObjHeader Server: Apache
  • ObjHeader Last-Modified: Fri, 23 Aug 2019 01:46:14 GMT
  • ObjHeader Accept-Ranges: bytes
  • ObjHeader Content-Length: 7725
  • ObjHeader Cache-Control: max-age=31536000
  • ObjHeader Expires: Wed, 09 Sep 2020 09:37:10 GMT
  • ObjHeader X-Frame-Options: SAMEORIGIN
  • ObjHeader Content-Type: image/jpeg
  • Fetch_Body 3 length stream
  • BackendClose 29 boot.default
  • Timestamp BerespBody: 1568108230.030469 0.002524 0.000082
  • Length 7725
  • BereqAcct 192 0 192 309 7725 8034
  • End

  • << Request >> 38

  • Begin req 37 rxreq
  • Timestamp Start: 1568108230.176665 0.000000 0.000000
  • Timestamp Req: 1568108230.176665 0.000000 0.000000
  • ReqStart 145.239.78.207 40768
  • ReqMethod GET
  • ReqURL /pub/static/version1567874318/frontend/Swissup/absolute/pt_PT/images/payments/ww.png
  • ReqProtocol HTTP/1.0
  • ReqHeader Host: www.test.com
  • ReqHeader Connection: close
  • ReqHeader X-Forwarded-For: 145.239.78.207
  • VCL_call RECV
  • ReqHeader grace: none
  • ReqURL /pub/static/version1567874318/frontend/Swissup/absolute/pt_PT/images/payments/ww.png
  • VCL_return pass
  • VCL_call HASH
  • VCL_return lookup
  • VCL_call PASS
  • VCL_return fetch
  • Link bereq 39 pass
  • Timestamp Fetch: 1568108230.178857 0.002191 0.002191
  • RespProtocol HTTP/1.0
  • RespStatus 200
  • RespReason OK
  • RespHeader Date: Tue, 10 Sep 2019 09:37:10 GMT
  • RespHeader Server: Apache
  • RespHeader Last-Modified: Tue, 03 Sep 2019 16:11:49 GMT
  • RespHeader Accept-Ranges: bytes
  • RespHeader Content-Length: 1003
  • RespHeader Cache-Control: max-age=31536000, public
  • RespHeader Expires: Wed, 09 Sep 2020 09:37:10 GMT
  • RespHeader X-Frame-Options: SAMEORIGIN
  • RespHeader Content-Type: image/png
  • RespProtocol HTTP/1.1
  • RespHeader X-Varnish: 38
  • RespHeader Age: 0
  • RespHeader Via: 1.1 varnish (Varnish/5.2)
  • VCL_call DELIVER
  • RespUnset Age: 0
  • VCL_return deliver
  • Timestamp Process: 1568108230.178877 0.002212 0.000021
  • RespHeader Connection: close
  • Timestamp Resp: 1568108230.178912 0.002246 0.000035
  • ReqAcct 155 0 155 363 1003 1366
  • End

  • << Session >> 37

  • Begin sess 0 HTTP/1
  • SessOpen 145.239.78.207 40768 a0 145.239.78.207 80 1568108230.176609 26
  • Link req 38 rxreq
  • SessClose REQ_CLOSE 0.002
  • End

  • << BeReq >> 98340

  • Begin bereq 98339 pass
  • Timestamp Start: 1568108230.180024 0.000000 0.000000
  • BereqMethod GET
  • BereqURL /pub/static/version1567874318/frontend/Swissup/absolute/pt_PT/images/payments/paypal.png
  • BereqProtocol HTTP/1.0
  • BereqHeader Host: www.test.com
  • BereqHeader X-Forwarded-For: 145.239.78.207
  • BereqHeader grace: none
  • BereqHeader X-Varnish: 98340
  • VCL_call BACKEND_FETCH
  • VCL_return fetch
  • BackendOpen 29 boot.default 145.239.78.207 8080 145.239.78.207 56974
  • BackendStart 145.239.78.207 8080
  • Timestamp Bereq: 1568108230.180132 0.000108 0.000108
  • BerespProtocol HTTP/1.0
  • Timestamp Beresp: 1568108230.181992 0.001968 0.001860
  • BerespProtocol HTTP/1.0
  • BerespStatus 200
  • BerespReason OK
  • BerespHeader Date: Tue, 10 Sep 2019 09:37:10 GMT
  • BerespHeader Server: Apache
  • BerespHeader Last-Modified: Tue, 03 Sep 2019 16:11:49 GMT
  • BerespHeader Accept-Ranges: bytes
  • BerespHeader Content-Length: 1757
  • BerespHeader Cache-Control: max-age=31536000, public
  • BerespHeader Expires: Wed, 09 Sep 2020 09:37:10 GMT
  • BerespHeader X-Frame-Options: SAMEORIGIN
  • BerespHeader Connection: close
  • BerespHeader Content-Type: image/png
  • VCL_call BACKEND_RESPONSE
  • TTL VCL -1 259200 0 1568108230
  • TTL VCL 120 259200 0 1568108230
  • VCL_return deliver
  • Storage malloc Transient
  • ObjProtocol HTTP/1.0
  • ObjStatus 200
  • ObjReason OK
  • ObjHeader Date: Tue, 10 Sep 2019 09:37:10 GMT
  • ObjHeader Server: Apache
  • ObjHeader Last-Modified: Tue, 03 Sep 2019 16:11:49 GMT
  • ObjHeader Accept-Ranges: bytes
  • ObjHeader Content-Length: 1757
  • ObjHeader Cache-Control: max-age=31536000, public
  • ObjHeader Expires: Wed, 09 Sep 2020 09:37:10 GMT
  • ObjHeader X-Frame-Options: SAMEORIGIN
  • ObjHeader Content-Type: image/png
  • Fetch_Body 3 length stream
  • BackendClose 29 boot.default
  • Timestamp BerespBody: 1568108230.182080 0.002055 0.000088
  • Length 1757
  • BereqAcct 204 0 204 316 1757 2073
  • End

  • << Request >> 98339

  • Begin req 98338 rxreq
  • Timestamp Start: 1568108230.179969 0.000000 0.000000
  • Timestamp Req: 1568108230.179969 0.000000 0.000000
  • ReqStart 145.239.78.207 40772
  • ReqMethod GET
  • ReqURL /pub/static/version1567874318/frontend/Swissup/absolute/pt_PT/images/payments/paypal.png
  • ReqProtocol HTTP/1.0
  • ReqHeader Host: www.test.com
  • ReqHeader Connection: close
  • ReqHeader X-Forwarded-For: 145.239.78.207
  • VCL_call RECV
  • ReqHeader grace: none
  • ReqURL /pub/static/version1567874318/frontend/Swissup/absolute/pt_PT/images/payments/paypal.png
  • VCL_return pass
  • VCL_call HASH
  • VCL_return lookup
  • VCL_call PASS
  • VCL_return fetch
  • Link bereq 98340 pass
  • Timestamp Fetch: 1568108230.182061 0.002092 0.002092
  • RespProtocol HTTP/1.0
  • RespStatus 200
  • RespReason OK
  • RespHeader Date: Tue, 10 Sep 2019 09:37:10 GMT
  • RespHeader Server: Apache
  • RespHeader Last-Modified: Tue, 03 Sep 2019 16:11:49 GMT
  • RespHeader Accept-Ranges: bytes
  • RespHeader Content-Length: 1757
  • RespHeader Cache-Control: max-age=31536000, public
  • RespHeader Expires: Wed, 09 Sep 2020 09:37:10 GMT
  • RespHeader X-Frame-Options: SAMEORIGIN
  • RespHeader Content-Type: image/png
  • RespProtocol HTTP/1.1
  • RespHeader X-Varnish: 98339
  • RespHeader Age: 0
  • RespHeader Via: 1.1 varnish (Varnish/5.2)
  • VCL_call DELIVER
  • RespUnset Age: 0
  • VCL_return deliver
  • Timestamp Process: 1568108230.182087 0.002118 0.000026
  • RespHeader Connection: close
  • Timestamp Resp: 1568108230.182146 0.002177 0.000058
  • ReqAcct 159 0 159 366 1757 2123
  • End
0
votes

Not enough detail for a succinct answer.

To cut the problem in-half, try to browse http address of the backend server?

Another important consideration, Have you properly configured, /etc/varnish/user.vcl ?

Here is a Varnish tutorial... https://www.linode.com/docs/websites/varnish/getting-started-with-varnish-cache/

Finally, find the location of the Varnish log file to get more details.

0
votes

I will post a complete log:

varnishlog * << BeReq >> 84 - Begin bereq 83 fetch - Timestamp Start: 1566844978.393604 0.000000 0.000000 - BereqMethod GET - BereqURL /index.php/giantpointsadmin/adminhtml_earning_rate/index - BereqProtocol HTTP/1.1 - BereqHeader Host: www.test.pt - BereqHeader User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36 - BereqHeader X-Forwarded-For: 51.89.7.90 - BereqHeader grace: none - BereqHeader Accept-Encoding: gzip - BereqHeader X-Varnish: 84 - VCL_call BACKEND_FETCH - VCL_return fetch - FetchError no backend connection - Timestamp Beresp: 1566844978.393680 0.000077 0.000077 - Timestamp Error: 1566844978.393687 0.000083 0.000007 - BerespProtocol HTTP/1.1 - BerespStatus 503 - BerespReason Service Unavailable - BerespReason Backend fetch failed - BerespHeader Date: Mon, 26 Aug 2019 18:42:58 GMT - BerespHeader Server: Varnish - VCL_call BACKEND_ERROR - BerespHeader Content-Type: text/html; charset=utf-8 - BerespHeader Retry-After: 5 - VCL_return deliver - Storage malloc Transient - ObjProtocol HTTP/1.1 - ObjStatus 503 - ObjReason Backend fetch failed - ObjHeader Date: Mon, 26 Aug 2019 18:42:58 GMT - ObjHeader Server: Varnish - ObjHeader Content-Type: text/html; charset=utf-8 - ObjHeader Retry-After: 5 - Length 279 - BereqAcct 0 0 0 0 0 0 - End

  • << Request >> 83
  • Begin req 82 rxreq
  • Timestamp Start: 1566844978.384062 0.000000 0.000000
  • Timestamp Req: 1566844978.393264 0.009202 0.009202
  • ReqStart 51.89.7.90 55715
  • ReqMethod GET
  • ReqURL /index.php/giantpointsadmin/adminhtml_earning_rate/index
  • ReqProtocol HTTP/1.1
  • ReqHeader Host: www.test.pt
  • ReqHeader Connection: keep-alive
  • ReqHeader Accept-Encoding: gzip,deflate
  • ReqHeader User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36
  • ReqHeader X-Forwarded-For: 51.89.7.90
  • VCL_call RECV
  • ReqHeader grace: none
  • ReqURL /index.php/giantpointsadmin/adminhtml_earning_rate/index
  • ReqUnset Accept-Encoding: gzip,deflate
  • ReqHeader Accept-Encoding: gzip
  • VCL_return hash
  • VCL_call HASH
  • VCL_return lookup
  • VCL_call MISS
  • VCL_return fetch
  • Link bereq 84 fetch
  • Timestamp Fetch: 1566844978.393832 0.009770 0.000568
  • RespProtocol HTTP/1.1
  • RespStatus 503
  • RespReason Backend fetch failed
  • RespHeader Date: Mon, 26 Aug 2019 18:42:58 GMT
  • RespHeader Server: Varnish
  • RespHeader Content-Type: text/html; charset=utf-8
  • RespHeader Retry-After: 5
  • RespHeader X-Varnish: 83
  • RespHeader Age: 0
  • RespHeader Via: 1.1 varnish (Varnish/5.2)
  • VCL_call DELIVER
  • VCL_return deliver
  • Timestamp Process: 1566844978.393857 0.009795 0.000025
  • RespHeader Content-Length: 279
  • RespHeader Connection: keep-alive
  • Timestamp Resp: 1566844978.393929 0.009868 0.000072
  • ReqAcct 266 0 266 247 279 526
  • End

  • << Session >> 82

  • Begin sess 0 HTTP/1
  • SessOpen 51.89.7.90 55715 a0 145.239.78.207 80 1566844978.383924 25
  • Link req 83 rxreq
  • SessClose REM_CLOSE 0.020
  • End

  • << BeReq >> 32855

  • Begin bereq 32854 pass
  • Timestamp Start: 1566844978.423125 0.000000 0.000000
  • BereqMethod POST
  • BereqURL /index.php/giantpointsadmin/adminhtml_earning_rate/index/
  • BereqProtocol HTTP/1.1
  • BereqHeader Host: www.test.pt
  • BereqHeader Accept-Encoding: gzip,deflate
  • BereqHeader Content-Type: multipart/form-data; boundary=----------------7O12ZqAnhn621bBI
  • BereqHeader Content-Length: 326
  • BereqHeader User-Agent: Opera/9.80 (Windows NT 6.0); U) Presto/2.12.388 Version/12.16
  • BereqHeader Cookie: adminhtml=86g8r80a2uhrf66b95f2lnslo0
  • BereqHeader X-Forwarded-For: 51.89.7.90
  • BereqHeader X-Varnish: 32855
  • VCL_call BACKEND_FETCH
  • VCL_return fetch
  • FetchError no backend connection
  • Timestamp Beresp: 1566844978.423157 0.000033 0.000033
  • Timestamp Error: 1566844978.423165 0.000040 0.000008
  • BerespProtocol HTTP/1.1
  • BerespStatus 503
  • BerespReason Service Unavailable
  • BerespReason Backend fetch failed
  • BerespHeader Date: Mon, 26 Aug 2019 18:42:58 GMT
  • BerespHeader Server: Varnish
  • VCL_call BACKEND_ERROR
  • BerespHeader Content-Type: text/html; charset=utf-8
  • BerespHeader Retry-After: 5
  • VCL_return deliver
  • Storage malloc Transient
  • ObjProtocol HTTP/1.1
  • ObjStatus 503
  • ObjReason Backend fetch failed
  • ObjHeader Date: Mon, 26 Aug 2019 18:42:58 GMT
  • ObjHeader Server: Varnish
  • ObjHeader Content-Type: text/html; charset=utf-8
  • ObjHeader Retry-After: 5
  • Length 282
  • BereqAcct 0 0 0 0 0 0
  • End

  • << Request >> 32854

  • Begin req 32853 rxreq
  • Timestamp Start: 1566844978.413495 0.000000 0.000000
  • Timestamp Req: 1566844978.422953 0.009458 0.009458
  • ReqStart 51.89.7.90 55717
  • ReqMethod POST
  • ReqURL /index.php/giantpointsadmin/adminhtml_earning_rate/index/
  • ReqProtocol HTTP/1.1
  • ReqHeader Host: www.test.pt
  • ReqHeader Connection: keep-alive
  • ReqHeader Accept-Encoding: gzip,deflate
  • ReqHeader Content-Type: multipart/form-data; boundary=----------------7O12ZqAnhn621bBI
  • ReqHeader Content-Length: 326
  • ReqHeader User-Agent: Opera/9.80 (Windows NT 6.0); U) Presto/2.12.388 Version/12.16
  • ReqHeader Cookie: adminhtml=86g8r80a2uhrf66b95f2lnslo0
  • ReqHeader X-Forwarded-For: 51.89.7.90
  • VCL_call RECV
  • VCL_return pass
  • VCL_call HASH
  • VCL_return lookup
  • VCL_call PASS
  • VCL_return fetch
  • Link bereq 32855 pass
  • Timestamp Fetch: 1566844978.423294 0.009799 0.000341
  • Storage malloc Transient
  • Timestamp ReqBody: 1566844978.423314 0.009819 0.000020
  • RespProtocol HTTP/1.1
  • RespStatus 503
  • RespReason Backend fetch failed
  • RespHeader Date: Mon, 26 Aug 2019 18:42:58 GMT
  • RespHeader Server: Varnish
  • RespHeader Content-Type: text/html; charset=utf-8
  • RespHeader Retry-After: 5
  • RespHeader X-Varnish: 32854
  • RespHeader Age: 0
  • RespHeader Via: 1.1 varnish (Varnish/5.2)
  • VCL_call DELIVER
  • VCL_return deliver
  • Timestamp Process: 1566844978.423336 0.009841 0.000022
  • RespHeader Content-Length: 282
  • RespHeader Connection: keep-alive
  • Timestamp Resp: 1566844978.423392 0.009897 0.000056
  • ReqAcct 374 326 700 250 282 532
  • End

  • << Session >> 32853

  • Begin sess 0 HTTP/1
  • SessOpen 51.89.7.90 55717 a0 145.239.78.207 80 1566844978.413439 24
  • Link req 32854 rxreq
  • SessClose REM_CLOSE 0.020
  • End

Best regards, Leonel Nunes