Ignore:
Timestamp:
2008-06-14 15:26:59 (6 years ago)
Author:
Poul-Henning Kamp <phk@…>
Branches:
master, 3.0, 4.0, experimental-ims
Children:
c2f51aa
Parents:
9adfd7
git-author:
Poul-Henning Kamp <phk@…> (2008-06-14 15:26:59)
git-committer:
Poul-Henning Kamp <phk@…> (2008-06-14 15:26:59)
Message:

Change defaults:

Make Grace mode the default with 10 seconds (param: default_grace)

Make the thread idle timeout 300 seconds (param: thread_pool_timeout)

Max one new thread per 20 msec (param: thread_pool_add_delay)

git-svn-id:  http://www.varnish-cache.org/svn/trunk/varnish-cache@2665 d4fa192b-c00b-0410-8231-f00ffab90ce4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bin/varnishd/cache_hash.c

    re5d00c r4352ff  
    5757#include <stdio.h> 
    5858#include <stdlib.h> 
     59#include <math.h> 
    5960#include <string.h> 
    6061#include <sys/types.h> 
     
    6667 
    6768static struct hash_slinger      *hash; 
     69 
     70static double 
     71HSH_Grace(double g) 
     72{ 
     73        if (isnan(g)) 
     74                return (double)(params->default_grace); 
     75        return (g); 
     76} 
    6877 
    6978/* Precreate an objhead and object for later use */ 
     
    100109                w->nobj->busy = 1; 
    101110                w->nobj->refcnt = 1; 
     111                w->nobj->grace = NAN; 
    102112                VTAILQ_INIT(&w->nobj->store); 
    103113                VTAILQ_INIT(&w->nobj->esibits); 
     
    222232 
    223233                /* Remember any matching objects inside their grace period */ 
    224                 if (o->ttl + o->grace >= sp->t_req) 
     234                if (o->ttl + HSH_Grace(o->grace) >= sp->t_req) 
    225235                        grace_o = o; 
    226236        } 
     
    232242        if (o == NULL && grace_o != NULL && 
    233243            grace_o->child != NULL && 
    234             grace_o->ttl + sp->grace >= sp->t_req) 
     244            grace_o->ttl + HSH_Grace(sp->grace) >= sp->t_req) 
    235245                o = grace_o; 
    236246 
Note: See TracChangeset for help on using the changeset viewer.