timeout problem with Play Framework

Baldur Norddahl baldur.norddahl at gmail.com
Sun Nov 28 10:56:18 CET 2010


I am using Varnish-cache in front of a website based on the Play Framework (
http://www.playframework.org/ - a java web framework). I started out with a
really simple varnish config file:

backend default {
    .host = "";
    .port = "9010";

backend joytools {
        .host = "";
        .port = "9020";

sub vcl_recv {
    if (req.http.host ~ "^(www.)?(joytools.dk|xn--bkkenbund-g3a.dk)$") {
        set req.backend = joytools;
    } else {
        set req.backend = default;

The purpose is to sort out requests to a HTTP virtual host to one backend
server and all other requests to another. This works.

However, on the first request or when doing a "refresh" in a browser the
site becomes extremely slow and unresponsive. I did some work with tcpdump
to find out what is going on. I captured this:

GET /public/javascripts/jquery-1.4.2.min.js HTTP/1.1
Host: xn--bkkenbund-g3a.dk
Referer: http://xn--bkkenbund-g3a.dk/
If-Modified-Since: Thu, 11 Mar 2010 09:57:53 GMT
Accept: */*
If-None-Match: "1268301473000--44924593"
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.7
(KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7
Accept-Encoding: gzip,deflate,sdch
Accept-Language: da,en-US;q=0.8,en;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
X-Varnish: 287151663

HTTP/1.1 304 Not Modified
Server: Play! Framework;1.1;dev
Cache-Control: no-cache
ETag: "1268301473000--44924593"


After this exchange between Play Framework and Varnish the connection is
idle for exactly 60 seconds before closing. It looks to me as if Play thinks
it is done replying but Varnish is expecting something more.

I hope an expert here can give me a quick pointer to how I proceed resolving
this issue.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20101128/5b84e73d/attachment-0003.html>

More information about the varnish-misc mailing list