httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul J. Reder" <>
Subject Re: Scoreboard redesign
Date Sat, 12 May 2001 03:12:14 GMT
Well since no one has commented, and I know how much everyone loves code
I'm going to go ahead and start implementing this in four phases:

1. Just update the data structures and minimal code to work with data
   structure changes. No other code changes. This mostly amounts to
   adding some extra as yet unused fields.
2. Add in code to update the data structure linkages (next pointers).
   This would still use the existing algorithms for using indexes into
   the allocated array and would still expect contiguous space. But the
   beginnings of the linked lists would be established.
3. Finish changing the code to remove any contiguous space requirements.
   All linked list work and use of worker_score pointers would be
   implemented here. This is the first big step.
4. Alter the worker creation and cleanup logic to take advantage
   of the new non-contiguous freedom provided in the previous steps.

If this doesn't stir up any comments, expect commits starting on Monday.

"Paul J. Reder" wrote:
> 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

View raw message