]> err.no Git - varnish/commitdiff
Split the http_workspace into sess_workspace and obj_workspace, so they
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 7 Mar 2008 11:13:11 +0000 (11:13 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 7 Mar 2008 11:13:11 +0000 (11:13 +0000)
can be tuned separately.

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

varnish-cache/bin/varnishd/cache_backend.c
varnish-cache/bin/varnishd/cache_hash.c
varnish-cache/bin/varnishd/cache_session.c
varnish-cache/bin/varnishd/heritage.h
varnish-cache/bin/varnishd/mgt_param.c

index 23dae5b8ce32955ff558e93e6795c48d6e60ffb8..c2f35a0a67fafabea9b8e2a30181ce5c5c23e1f2 100644 (file)
@@ -230,7 +230,7 @@ VBE_new_bereq(void)
        if (bereq != NULL) {
                CHECK_OBJ(bereq, BEREQ_MAGIC);
        } else {
-               len =  params->mem_workspace;
+               len =  params->sess_workspace;
                bereq = calloc(sizeof *bereq + len, 1);
                if (bereq == NULL)
                        return (NULL);
index f18c51db77724ecab0a5f1600e0dfd2e1ec7956f..5c628f5dd6421a3100b030fe1111f9e193fecb1a 100644 (file)
@@ -88,7 +88,7 @@ HSH_Prealloc(struct sess *sp)
        } else
                CHECK_OBJ_NOTNULL(w->nobjhead, OBJHEAD_MAGIC);
        if (w->nobj == NULL) {
-               st = STV_alloc(sp, params->mem_workspace);
+               st = STV_alloc(sp, params->obj_workspace);
                XXXAN(st);
                assert(st->space > sizeof *w->nobj);
                w->nobj = (void *)st->ptr; /* XXX: align ? */
index 01ae3de6d1fb8661dd0803e41f101b6ee3a74561..b15b59b8f7728558173006a06d76a2d920026c50 100644 (file)
@@ -289,7 +289,7 @@ SES_New(const struct sockaddr *addr, unsigned len)
                 * need to cache it locally, to make sure we get a
                 * consistent view of it.
                 */
-               u = params->mem_workspace;
+               u = params->sess_workspace;
                sm = malloc(sizeof *sm + u);
                if (sm == NULL)
                        return (NULL);
@@ -346,7 +346,7 @@ SES_Delete(struct sess *sp)
            sp->addr, sp->port, sp->t_end - b->first,
            b->sess, b->req, b->pipe, b->pass,
            b->fetch, b->hdrbytes, b->bodybytes);
-       if (sm->workspace != params->mem_workspace) {
+       if (sm->workspace != params->sess_workspace) {
                VSL_stats->n_sess_mem--;
                free(sm);
        } else {
index 5cd3ecf5db40d2d1bc53e3f85ec97d07f0a3f6f5..7d011efdab6711ba26eefcc428a96f6940f99377 100644 (file)
@@ -85,7 +85,8 @@ struct params {
        unsigned                overflow_max;
 
        /* Memory allocation hints */
-       unsigned                mem_workspace;
+       unsigned                sess_workspace;
+       unsigned                obj_workspace;
 
        /* Acceptor hints */
        unsigned                sess_timeout;
index 8b6edac0e6ca30a0056612718479fd6a888d4b77..c394ea9f26c7084cb250caa518e31dfbd9e9c542 100644 (file)
@@ -495,13 +495,21 @@ static const struct parspec parspec[] = {
                "number of worker threads.  ",
                EXPERIMENTAL,
                "3", "requests per request" },
-       { "http_workspace", tweak_uint, &master.mem_workspace, 1024, UINT_MAX,
-               "Bytes of HTTP protocol workspace allocated. "
+       { "sess_workspace", tweak_uint, &master.sess_workspace, 1024, UINT_MAX,
+               "Bytes of HTTP protocol workspace allocated for sessions. "
                "This space must be big enough for the entire HTTP protocol "
                "header and any edits done to it in the VCL code.\n"
                "Minimum is 1024 bytes.",
                DELAYED_EFFECT,
                "8192", "bytes" },
+       { "obj_workspace", tweak_uint, &master.obj_workspace, 1024, UINT_MAX,
+               "Bytes of HTTP protocol workspace allocated for objects. "
+               "This space must be big enough for the entire HTTP protocol "
+               "header and any edits done to it in the VCL code while it "
+               "is cached.\n"
+               "Minimum is 1024 bytes.",
+               DELAYED_EFFECT,
+               "8192", "bytes" },
        { "sess_timeout", tweak_timeout, &master.sess_timeout, 0, 0,
                "Idle timeout for persistent sessions. "
                "If a HTTP request has not been received in this many "