On Thu, 24 Nov 2005, [EMAIL PROTECTED] wrote:

when i read the two lines below(line 1098 in http.c),i have a question about persistent connection between caches
else if (p->stats.n_keepalives_sent < 10)
        httpState->flags.keepalive = 1;
else if ((double) p->stats.n_keepalives_recv / (double) p->stats.n_keepalives_sent > 0.50)
        httpState->flags.keepalive = 1;

why we have to keep the rate about n_keepalives_recv and stats.n_keepalives_sent .and why we need to keep n_keepalives_sent < 10? someone can tell me the reason? thanks

I forget the exact original motivation, but the idea is to figure
out if the other proxy correctly supports persistent connections.
If it does support them, then the keepalive ratio should be greater
than 50%.

If it does not support them, then Squid should not bother to try
using persistent connections.

The "10" is there so that Squid tries to use persistent connections
at least 10 times.  We want a decent sample size before calculating
the ratio.

DW

Reply via email to