Apache 1.3 API Documentation

Structure vtime_t

Definition:

typedef unsigned vtime_t;
     

Usage example:

short_score *ss; 
parent_score *ps = &ap_scoreboard_image->parent[i]; 
if (ss->cur_vtime != ps->last_vtime) { 
    /* it has made progress, so update its last_rtime, 
    * last_vtime */ 
    ps->last_rtime = now; 
    ps->last_vtime = ss->cur_vtime; 
} 
else if (ps->last_rtime + ss->timeout_len < now) { 
    /* no progress, and the timeout length has been exceeded */ 
    ss->timeout_len = 0; 
    kill(ps->pid, SIGALRM); 
} 
     

A "virtual time" is simply a counter that indicates that a child is making progress. The parent checks up on each child, and when they have made progress it resets the last_rtime element. But when the child hasn't made progress in a time that's roughly timeout_len seconds long, it is sent a SIGALRM.

Vtime is an optimization that is used only when the scoreboard is in shared memory (it's not easy/feasible to do it in a scoreboard file). The essential observation is that timeouts rarely occur, the vast majority of hits finish before any timeout happens. So it really is suboptimal to have to ask the operating system to set up and destroy alarms many times during a request.

See also:
ap_exists_scoreboard_image, ap_scoreboard_image, ap_sync_scoreboard_image, global_score, parent_score, scoreboard, SERVER_BUSY_DNS, SERVER_BUSY_KEEPALIVE, SERVER_BUSY_LOG, SERVER_BUSY_READ, SERVER_BUSY_WRITE, SERVER_DEAD, SERVER_GRACEFUL, SERVER_NUM_STATUS, SERVER_READY, SERVER_STARTING, short_score, START_PREQUEST, STOP_PREQUEST

Previous: uri_components Next: (none)

Table of Contents (Routines, Structures, Data Cells, Constants)