How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

March 14, 2013

Varnish Error 503 Service unavailable… Guru Meditation

Filed under: Linux — Tags: , , — admin @ 2:07 pm

Today I have face a big problem while using varnish with nginxcp + cpanel on a vps server .
Well the main site was working that was using a wordpress, however admin area because have a lot of plugins crashed with that stupid error.
So after a long search in ngnix log I find this error
upstream prematurely closed connection while reading response header from upstream
and this
an upstream response is buffered to a temporary file

However this seem’s that are not the problem for unavailable problem. However a fix for those error is to disable log in proxy.inc just add
proxy_buffering off;

However the fix is this in the varnish configuration default.vcl
backend default {
.host = “127.0.0.1”;
.port = “81”;
}

So after I modify this with

backend default {
.host = “127.0.0.1”;
.port = “81”;
.connect_timeout = 120s;
.first_byte_timeout = 120s;
.between_bytes_timeout = 120s;
}

The problem suddenly disappear . So basically the timeout should be increased for admin area if you have a lot of plugins there in wordpress and you are on a small vps.

Powered by WordPress