httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul J. Reder" <rede...@raleigh.ibm.com>
Subject Scoreboard redesign
Date Thu, 10 May 2001 18:16:14 GMT
The basic idea is to separate the parts of the scoreboard that Apache
needs for process/thread management from the part that mod_status
needs for server-status.
 
This frees the mpm from having to allocate the server-status part of the
scoreboard if mod_status is not loaded. It also gives us the opportunity
to stub out the scoreboard status functions if mod_status is not loaded
so that we don't pay the request processing overhead of updating status
that is never used.
 
The basic data structures are as follows:
 
ap_scoreboard_image
        |
        |                                  |---> worker_score
        -------------> parent_score        |        thread_num
                           pid             |        tid
                           generation      |        status
                           sb_type         |        access_count
                           worker_threads  |        bytes_served
                           worker_head  ---|        my_access_count
                           next ---|                my_bytes_served
                                   |                conn_bytes
                                   |                conn_count
                                   |                life_status
                                   |                start_time
                        |----------|                stop_time
                        v                           times
                       parent_score                 last_used
                           ...                      client[]
                                                    request[]
                                                    vhostrec
                                                    next ---|
                                                            |
                                                   |--------|
                                                   v
                                                 worker_score
                                                    ...
 
When the worker thread/process is started it is given the pointer
to its worker_score which it will then pass around to process_socket
and other calls so that the request processing can update the status
info.
 
When the connection is established, instead of storing the index to
the child it stores the pointer to the worker_score in the conn_rec.
 
This allows the worker_score structures to be allocated in any way
we want: as a fixed size array; as a reusable set in a list; ...
The parents can refer to workers in any order within the scoreboard
(not just contiguously).
 
This design enables finer granularity management of processes and
threads from each of the mpms as well as improved performance by
limiting status update overhead if not needed.
 
Credits:
  Bill Stoddard:    Concept of breaking up and allocating
                    mod_status structures/memory.
  Ryan Bloom and
    Chuck Murcko:   The idea of reuse of parts of the
                    scoreboard.
 
  Jeff Trawick:     The idea of using linked lists.    
-- 
Paul J. Reder
-----------------------------------------------------------
"The strength of the Constitution lies entirely in the determination of each
citizen to defend it.  Only if every single citizen feels duty bound to do
his share in this defense are the constitutional rights secure."
-- Albert Einstein

Mime
View raw message