Varnish 启动失败。运行 VCC-compiler 失败,没有编译器错误

Varnish 启动失败。运行 VCC-compiler 失败,没有编译器错误

编辑:系统磁盘空间不足,因此编译器无法创建文件。varnishd 的输出不会告诉您这一点。

如果出现没有明显原因的奇怪错误,请务必检查磁盘配额:)

六小时后我会亲自回答。

我正在运行由主管控制的清漆。

Varnish 运行缓慢,当我使用 Supervisor 重新启动 Varnish 时,没有任何变化。

但手动执行后重启失败 sbin/varnishd -F -f etc/varnish/ourconfig.vcl -a localhost -p thread_pool_min=10 -p thread_pool_max=50 -s malloc,250M

我收到以下错误

运行 VCC 编译器失败,退出 1

VCL编译失败

而已。

这是我们的 vcl 文件:

backend default {
    .host = "127.0.0.1";
    .port = "8002";
    .first_byte_timeout = 300s;
}

sub vcl_recv {
     if (req.request == "BAN") {
        ban("obj.http.X-Keywords ~ " + req.http.X-Ban-Keywords);
     }

     if (req.request != "GET" && req.request != "HEAD") {
        return (pass);
     }

     // Remove has_js and Google Analytics __* cookies.
     set req.http.Cookie = regsuball(req.http.Cookie, "(^|;\s*)(__(ut|at)[a-z]+|has_js)=[^;]*", "");
     // Remove a ";" prefix, if present.
     set req.http.Cookie = regsub(req.http.Cookie, "^;\s*", "");

     set req.grace = 5m;

     if (req.url ~".*(jpg|gif|kss|css|js|png|svg|woff)$") {
        unset req.http.Authorization;
        unset req.http.Cookie;
     }

     if (req.http.Authorization || req.http.Cookie ~ "__ac") {
         return (pass);
     }

     return (lookup);
}

sub vcl_fetch {

  if (req.url ~".*(jpg|gif|kss|css|js|png|svg|woff)$") {
    set beresp.ttl = 86400s;
  }

  if (req.url ~ "/login_form$" || req.http.Cookie ~ "__ac") {
      return (hit_for_pass);
  }
  set beresp.grace = 5m;
  unset beresp.http.Set-Cookie;
  unset beresp.http.Pragma;
  unset beresp.http.Cache-Control;

  if (beresp.ttl < 15m) {
      set beresp.ttl = 15m;
  }

  # images should live one day
  if (req.url ~ "\/(image|image_thumb|image_mini|cover_image|image_small|image_preview)$") {
      set beresp.ttl = 1209600s;
      set beresp.http.cache-control = "max-age=1209600;s-maxage=1209600";
      set beresp.http.max-age = "1209600";
      set beresp.http.s-maxage = "1209600";
      set beresp.http.expires = "1209600";
  }
  if (req.url ~ "\.(png|gif|jpg|swf|otf|ttf|woff|svg)$") {
      set beresp.ttl = 1209600s;
      set beresp.http.cache-control = "max-age=1209600;s-maxage=1209600";
      set beresp.http.max-age = "1209600";
      set beresp.http.s-maxage = "1209600";
      set beresp.http.expires = "1209600";
  }
  # resource files should live 14 days to make google happy
  if (req.url ~ "\.(css|js|kss)$") {
      set beresp.ttl = 1209600s;
      set beresp.http.cache-control = "max-age=1209600;s-maxage=1209600";
      set beresp.http.max-age = "1209600";
      set beresp.http.s-maxage = "1209600";
      set beresp.http.expires = "1209600";
  }

  if (beresp.status >= 500 || beresp.status == 403 || beresp.status == 302) {
      set beresp.ttl = 0s;
  }

  return (deliver);
}

sub vcl_deliver {
  set resp.http.X-Hits = obj.hits;
}

任何帮助都将不胜感激。非常感谢!

答案1

为了将其注册为答案,OP 发现解决方案是;

不,问题是磁盘满了。所以没有剩余空间来编译文件。清理后一切又恢复正常了。这也是速度变慢的原因,我这个笨蛋。:) 无论如何,谢谢你的建议!–

相关内容