You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ICS.UCI.EDU> on 1999/09/02 00:53:50 UTC
Re: Maintaining status tables across restart
>I'm working on the 2nd iteration of a mod_status API with the ability
>for all modules to register status columns. One problem I'm trying to
>deal with is graceful restart. During different generations, we could
>have different modules loaded, each supplying different data. Now, I'm
>trying to allow both shared memory and pipes as implementations of the
>API, but my first implementation will be shared memory.
>
>For shared memory, Ken suggested that the server could maintain a list
>of scoreboards; one per generation. During a graceful restart, a new
>generation's scoreboard is created, and an old scoreboard is cleaned
>up when the last child of that generation goes away. Is this feasible?
>Any better ideas?
Why not just have a status field that indicates the child's generation?
In other words, why does the scoreboard have to change across generations
if it is shared memory and a graceful restart?
....Roy
Re: Maintaining status tables across restart
Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Roy T. Fielding wrote:
>
> Why not just have a status field that indicates the child's generation?
> In other words, why does the scoreboard have to change across generations
> if it is shared memory and a graceful restart?
Well, if the restarted server includes different modules, the
amount of contribution to a variable scoreboard will be
different between generations.
--
#ken P-)}
Ken Coar <http://Web.Golux.Com/coar/>
Apache Software Foundation <http://www.apache.org/>
"Apache Server for Dummies" <http://ASFD.MeepZor.Com/>
Re: Maintaining status tables across restart
Posted by Manoj Kasichainula <ma...@io.com>.
On Thu, Sep 02, 1999 at 04:17:09PM -0700, Roy T. Fielding wrote:
> I think that is the way to go -- add a single extended status pointer
> that points to a shared memory data structure (one per child). Start
> with a simple structure (like a linked list of field-value pairs) and
> only access it through ADT functions. We can optimize it later. I think
> this would be a safer path than trying to store a sparse dynamic table
> inside the scoreboard.
>
> BTW, if the modules pre-register fields, you can change the internal
> structure to be a perfect hash or AVL tree to improve efficiency.
Of course, if the modules are pre-registering fields, we've
essentially implemented a sparse table data structure, right? But then
we have more cross-restart pains to deal with.
The API I've had planned for the status table should already allow
implementation with nothing but key-value pairs in shared memory
(assuming that one of the parts of the key is the connection ID, which
I think is essential).
As a first cut, I'm thinking of having the implementation maintain one
row per connection. Each row would be filled with key-value pairs,
because it's very close to what is implemented so far.
And after a little hackery on Ben's symbol code, it seems to work
beautifully, meaning that these keys can be symbols.
--
Manoj Kasichainula - manojk at io dot com - http://www.io.com/~manojk/
"If it weren't for us you would be drooling in your laps instead of on your
keyboards!" -- Darrell Fuhriman
Re: Maintaining status tables across restart
Posted by Manoj Kasichainula <ma...@io.com>.
On Wed, Sep 01, 1999 at 07:13:04PM -0700, Roy T. Fielding wrote:
> >> Why not just have a status field that indicates the child's generation?
> >> In other words, why does the scoreboard have to change across generations
> >> if it is shared memory and a graceful restart?
> >
> >This is possible, but then, we have to create an arbitrary limit on
> >the "length" of a row, i.e. how much space any row can take up in the
> >shared memory table. Since rows can actually change size between
> >restarts, the last thing we want to worry about is shared memory
> >fragmentation, so we have to align the rows on these boundaries.
>
> Ah, so that's the reason -- changing row size due to a config change.
> But Apache 1.3.9 has a fixed, compile-time record size, so I'd have
> to understand what dynamicity is being added to 2.0 that would cause
> that to be a concern.
It looks like you hit the nail on the head below. I'm trying to let
modules add their own columns to the status table.
> We already have that. Instead of letting modules add fields directly
> to the scoreboard, which would introduce a host of messy problems,
> how about adding a single shared-memory pointer field to a per-child
> shared-memory table of key-value pairs?
We did need a good way to deal wih the insane sparseness of the table;
this might do the trick, though it might make the job of an mod_status
even harder.
> It would be slower for children
> actually using that field for status, but how often is that going to occur?
> Besides, your status displayer is going to need something to indicate
> what to do with each extended field item.
All fields in the table are strings, and modules would register table
headers as well. then, mod_status would simply display one big table
(possibly split up into some smaller tables for connections on
different protocols or something; this wasn't completely worked out)
But mod_status wasn't the primary goal; hopefully, the API will be
good enough for an SNMP module as well; I just know more about writing
mod_statuses than mod_snmps.
> Actually, I'm having a real hard time justifying a need for any of this,
Well, originally, I was just planning to write code to support various
protocol modules. Protocol modules had to be able to provide custom
columns (name-based vhosts are an HTTP-specific feature) and putting
in support for arbitrary modules to do the same shouldn't be that much
harder.
> since having dynamic fields doesn't change the fact that only a dynamic
> status module could display them, which means the status module needs to
> know the structure of the shared memory fields anyway.
If everything is a string, this conceptually isn't too hard (though
actual implementation may be harder). The implementation I posted last
week did this for MPM-specific columns, and mod_status used them. It's
somewhat harder to do this for other modules, for those modules to
keep this data updated, and to deal with restarts though.
> Just make it a
> compile-time include with an extension pointer in the scoreboard (and
> abuse anyone who wants to compile-in more than one extended status module).
What do you mean by the extension pointer exactly? Custom status
modules would add custom code to mangle the target of that pointer?
Dropping module-maintained status entries means dropping
protocol-specific status entries, or only suporting HTTP. I'm not
opposed to eliminating feature creep in 2.0, so it's not a big deal,
but this feature would be pretty cool.
--
Manoj Kasichainula - manojk at io dot com - http://www.io.com/~manojk/
Re: Maintaining status tables across restart
Posted by Manoj Kasichainula <ma...@io.com>.
On Wed, Sep 01, 1999 at 03:53:50PM -0700, Roy T. Fielding wrote:
> Why not just have a status field that indicates the child's generation?
> In other words, why does the scoreboard have to change across generations
> if it is shared memory and a graceful restart?
This is possible, but then, we have to create an arbitrary limit on
the "length" of a row, i.e. how much space any row can take up in the
shared memory table. Since rows can actually change size between
restarts, the last thing we want to worry about is shared memory
fragmentation, so we have to align the rows on these boundaries.
Is this an acceptable limitation? It's not *too* bad; the worst it can
mean is that we tell users to recompile with a higher
HARD_ROW_LENGTH_LIMIT.
--
Manoj Kasichainula - manojk at io dot com - http://www.io.com/~manojk/
"Yes, I know a nose is not a butt." -- Darrell Fuhriman