Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weird Varnish 503 error - what does this mean?

Tags:

varnish

My online whiteboard application has been working previously, but for whatever reason, it no longer works. Now it shows a 503 Varnish cache error as seen here: http://grab.by/eFHG

Do you happen to know where I should start to look to try to resolve this issue?

Thanks! Donny

like image 893
Donny Avatar asked Jul 10 '12 19:07

Donny


People also ask

How do I fix error 503 Varnish Cache server?

The default length of cache tags in Varnish is 8192 bytes. Exceeding this can cause the HTTP 503 Backend Fetch Failed error. You can resolve this issue by increasing the value of the http_resp_hdr_len parameter in your Varnish configuration file.

What is a Varnish error?

Varnish Cache issues the Guru Meditation error when a connection has timed out or the Varnish Cache server has made too many requests to the back end server without getting a response.

What does this mean error 503 backend is unhealthy?

Error 503 backend is unhealthyThis error appears when custom health checks report a backend as down. It typically occurs when a Fastly edge server receives a client request and must make a request to your origin, but because the backend is considered unhealthy, Fastly doesn't try to send the request at all.

How do I fix error 503 backend is unhealthy?

As “Error 503 Backend Fetch Failed' is mainly caused when the cache server gets temporarily overloaded, you don't want to take any chances, right? When you encounter this error on a specific website, make sure that you close all other active tabs and services to lighten the load of cache server memory.


2 Answers

This error means that Varnish had no response (even not an HTTP error) from the backend within the timeout limit.

You can troubleshoot that in many ways :

  • On the backend : do you see requests from Varnish in your webserver log ?

  • On Varnish server : Run varnishlog and check the request process. You should have events in this order : RxRequest > TxRequest > RxResponse > TxResponse. Your problem is between TxRequest (request sent to backend) and RxResponse (response received from backend).

  • On your Varnish server try connecting on the backend using telnet (telnet ). Does it connect ? If it does, try sending a request (e.g. "GET / "). Do you receive a response ?

Probable causes could be : firewall/selinux blocking between varnish & backend, bad varnish or backend web server config (are backend address & port sync ?), webserver stopped, ...

like image 81
Gauthier Delacroix Avatar answered Oct 12 '22 06:10

Gauthier Delacroix


You could always check your /etc/varnish/default.vcl (CentOS).

backend default {
  .host = "127.0.0.1";
  .port = "80";
}

Make sure the .host value is your server IP Address, and change the port to 8080, and adjust your port setting in /etc/httpd/conf/httpd.conf and make sure Apache listen to 8080.

EDIT
It could also mean web server (Apache) have wrong/default settings.

  • Check the virtual host ports, the values might be 80, they should be 8080.
  • Check Listen directive and ServerName, they must have 8080 port.
  • Make sure you do sudo systemctl enable varnish.
  • And for the final touch, do sudo reboot (cache programs are bugging me in the development state).
like image 39
John Smith Avatar answered Oct 12 '22 07:10

John Smith