]> err.no Git - varnish/commitdiff
Eliminate the session_grace thing, the inter-request interval is to
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 15 Sep 2006 16:18:27 +0000 (16:18 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 15 Sep 2006 16:18:27 +0000 (16:18 +0000)
large in general (think RTT) for this to make sense, it costs a syscall
and if a delay is used, at least two context switches.

We still capture sessions that do pipe-line avoiding the context switch
in that case, without incurring the syscall overhead.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@995 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_center.c
varnish-cache/bin/varnishd/mgt_param.c
varnish-cache/include/stat_field.h

index 875a706d33571061db347cc4e87ebed56365a418..6d577d20323cd2c15fb9dc0d1d4b94a8b0f07827 100644 (file)
@@ -33,7 +33,6 @@ DOT start -> RECV
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <poll.h>
 
 #include "shmlog.h"
 #include "heritage.h"
@@ -124,8 +123,6 @@ static int
 cnt_done(struct sess *sp)
 {
        double dh, dp, da;
-       struct pollfd fds[1];
-       int i;
 
        AZ(sp->obj);
        AZ(sp->vbc);
@@ -171,26 +168,7 @@ cnt_done(struct sess *sp)
                sp->step = STP_AGAIN;
                return (0);
        }
-       if (params->session_grace == 0) {
-               VSL_stats->sess_herd++;
-               sp->wrk->idle = sp->t_open.tv_sec;
-               vca_return_session(sp);
-               return (1);
-       }
-       fds[0].fd = sp->fd;
-       fds[0].events = POLLIN;
-       fds[0].revents = 0;
-       i = poll(fds, 1, params->session_grace);
-       if (i == 1 && (fds[0].revents & POLLHUP)) {
-               VSL_stats->sess_EOF++;
-               vca_close_session(sp, "EOF");
-       } else if (i == 1 && (fds[0].revents & POLLIN)) {
-               VSL_stats->sess_ready++;
-               sp->step = STP_AGAIN;
-               return (0);
-       } else {
-               VSL_stats->sess_herd++;
-       }
+       VSL_stats->sess_herd++;
        sp->wrk->idle = sp->t_open.tv_sec;
        vca_return_session(sp);
        return (1);
index 715f2fe447ad1b558dc4eef934934c24109c96ef..ff3879f12e64dc456369fe04fb55ffd3735851cc 100644 (file)
@@ -168,23 +168,6 @@ tweak_send_timeout(struct cli *cli, struct parspec *par, const char *arg)
 
 /*--------------------------------------------------------------------*/
 
-static void
-tweak_session_grace(struct cli *cli, struct parspec *par, const char *arg)
-{
-       unsigned u;
-
-       (void)par;
-       if (arg != NULL) {
-               u = strtoul(arg, NULL, 0);
-               params->session_grace = u;
-       }
-       if (cli == NULL)
-               return;
-       cli_out(cli, "%u [milliseconds]\n", params->session_grace);
-}
-
-/*--------------------------------------------------------------------*/
-
 static void
 tweak_auto_restart(struct cli *cli, struct parspec *par, const char *arg)
 {
@@ -318,11 +301,6 @@ static struct parspec parspec[] = {
                "The minimum size of objects transmitted with sendfile.\n"
                "Default is 8192 bytes.", "8192" },
 #endif /* HAVE_SENDFILE */
-       { "session_grace", tweak_session_grace,
-               "How long a workerthread waits for a new request to arrive "
-               "before sending the session to the herder.\n"
-               "Units are milliseconds, zero disables.\n"
-               "Default is disabled.", "0" },
        { NULL, NULL, NULL }
 };
 
index 8a171df19e85a25091556a18fe59077eccfb34d8..acbf9f77fa9943be4e341c6d1cf54e0f3bf7bd02 100644 (file)
@@ -47,6 +47,4 @@ MAC_STAT(s_bodybytes,         uint64_t, "u", "Total body bytes")
 MAC_STAT(sess_closed,          uint64_t, "u", "Session Closed")
 MAC_STAT(sess_pipeline,                uint64_t, "u", "Session Pipeline")
 MAC_STAT(sess_readahead,       uint64_t, "u", "Session Read Ahead")
-MAC_STAT(sess_EOF,             uint64_t, "u", "Session EOF")
-MAC_STAT(sess_ready,           uint64_t, "u", "Session Ready")
 MAC_STAT(sess_herd,            uint64_t, "u", "Session herd")