You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Matt Sergeant <ma...@sergeant.org> on 2005/06/20 23:36:07 UTC

Scoreboard plans?

I see in the docs there's a stub to return $c->sbh - a scoreboard 
handle. Are there any plans to implement this any time soon?

Reason I ask is that apache.org has now switched it's mail to using 
Apache::Qpsmtpd - yes that's right - a mail server built on mod_perl 
2.0 - you guys should be proud of yourselves as it was very easy to 
create.

However the scoreboard doesn't seem to work right with protocol 
handlers. The remote_ip isn't filled in, despite clearly being 
available to the smtp code, and there's stuff I'd like to add in there, 
like setting the request entry to contain the currently in-process SMTP 
verb (i.e. MAIL FROM or DATA or whatever).

You can see what I mean at http://mail.apache.org/server-status

Matt.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Scoreboard plans?

Posted by Malcolm J Harwood <mj...@liminalflux.net>.
On Tuesday 21 June 2005 04:19 pm, Matt Sergeant wrote:

> > I'm not sure if it makes sense to have it in Apache2::Connection, as the
> > WorkerScore is process/thread based rather than connection based. (It
> > does have connection specific information in it, but it also has more long
> > lived data).
> I'm guessing it's there because that's where it's stored in the Apache
> internals. My suspicion (without digging) is that the scoreboard-worker
> (i.e. a line in the scoreboard) lives with a connection, and when that
> connection goes on to process another request it gets updated
> appropriately.

The whole thing is a shared memory block. The worker lives with a 
process/thread. The scoreboard has many processes, each process has one or 
more workers depending on whether you are running threads or not.

The worker stores some things that are process/thread specific (eg. bytes 
served since this process/thread was started), some that are connection 
specific (eg. number of requests served) and some that are request specific 
(eg. name of the request).

So the worker is this odd amalgam of data with different scopes.

To my mind, any accessors therefor belongs more in Apache::Scoreboard than in 
Apache2::Connection. Having Apache::Scoreboard provide a "current_worker()" 
function would make sense though.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Scoreboard plans?

Posted by Matt Sergeant <ma...@sergeant.org>.
On 21 Jun 2005, at 14:56, Malcolm J Harwood wrote:

> I'm not sure if it makes sense to have it in Apache2::Connection, as 
> the
> WorkerScore is process/thread based rather than connection based. (It 
> does
> have connection specific information in it, but it also has more long 
> lived
> data).

I'm guessing it's there because that's where it's stored in the Apache 
internals. My suspicion (without digging) is that the scoreboard-worker 
(i.e. a line in the scoreboard) lives with a connection, and when that 
connection goes on to process another request it gets updated 
appropriately.

Matt.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Scoreboard plans?

Posted by Malcolm J Harwood <mj...@liminalflux.net>.
On Tuesday 21 June 2005 02:28 pm, Matt Sergeant wrote:

> >> I see in the docs there's a stub to return $c->sbh - a scoreboard
> >> handle. Are there any plans to implement this any time soon?
> > Which docs?
> Apache2::Connection - right at the end.

Hrm. I don't know anything about it. Stas might (but he's off travelling the 
world at the moment).

> > The update to Apache::Scoreboard should go out later this week (RCs
> > available if you'd like to test).
> I assume it's no different - I already got it to work with a few simple
> changes.

There's a few non-rename related fixes, but otherwise no, it's not a big 
change. (Though moving it to the Apache2 namespace might make sense at this 
point).

> >> However the entire API is read-only. Is there any way to write the
> >> scoreboard?
> > I don't see why it wouldn't be possible. It's just not exposed through
> > the current Apache::Scoreboard API, as no one seems to have ever needed
> > it. If you want to submit a patch to Apache::Scoreboard feel free. :) I'm
> > not sure what the best approach to providing a writable API would be here.
> I'm guessing just make the getters also setters. Plus it'd have to be
> extended to be able to provide the current ScoreboardWorkerScore. I'm
> wondering if that's the same as $c->sbh.

I'm not sure if it makes sense to have it in Apache2::Connection, as the 
WorkerScore is process/thread based rather than connection based. (It does 
have connection specific information in it, but it also has more long lived 
data).

It should be relatively easy to add such to Apache::Scoreboard though.



-- 
"How wonderful it is that nobody need wait a single moment to
 improve the world."
- Anne Frank, Diary of a Young Girl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Scoreboard plans?

Posted by Matt Sergeant <ma...@sergeant.org>.
On 21 Jun 2005, at 11:43, Malcolm J Harwood wrote:

> On Monday 20 June 2005 05:36 pm, Matt Sergeant wrote:
>
>> I see in the docs there's a stub to return $c->sbh - a scoreboard
>> handle. Are there any plans to implement this any time soon?
>
> Which docs?

Apache2::Connection - right at the end.

>> OK, so answering my own question - looks like Apache::Scoreboard
>> already works on mod-perl2, modulo a bunch of patches to bring it up 
>> to
>> date wrt the Apache2 rename.
>
> The update to Apache::Scoreboard should go out later this week (RCs 
> available
> if you'd like to test).

I assume it's no different - I already got it to work with a few simple 
changes.

>> However the entire API is read-only. Is there any way to write the
>> scoreboard?
>
> I don't see why it wouldn't be possible. It's just not exposed through 
> the
> current Apache::Scoreboard API, as no one seems to have ever needed 
> it. If
> you want to submit a patch to Apache::Scoreboard feel free. :) I'm not 
> sure
> what the best approach to providing a writable API would be here.

I'm guessing just make the getters also setters. Plus it'd have to be 
extended to be able to provide the current ScoreboardWorkerScore. I'm 
wondering if that's the same as $c->sbh.

Matt.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Scoreboard plans?

Posted by Malcolm J Harwood <mj...@liminalflux.net>.
On Monday 20 June 2005 05:36 pm, Matt Sergeant wrote:

> I see in the docs there's a stub to return $c->sbh - a scoreboard
> handle. Are there any plans to implement this any time soon?

Which docs?

> Reason I ask is that apache.org has now switched it's mail to using
> Apache::Qpsmtpd - yes that's right - a mail server built on mod_perl
> 2.0 - you guys should be proud of yourselves as it was very easy to
> create.
>
> However the scoreboard doesn't seem to work right with protocol
> handlers. The remote_ip isn't filled in, despite clearly being 
> available to the smtp code, 

That particular case sounds like an apache-side problem rather than a mod_perl 
one. I don't know enough apache guts yet though, and even less about protocol 
handlers.

> and there's stuff I'd like to add in there,
> like setting the request entry to contain the currently in-process SMTP
> verb (i.e. MAIL FROM or DATA or whatever).

On Monday 20 June 2005 06:05 pm, Matt Sergeant wrote:

> OK, so answering my own question - looks like Apache::Scoreboard
> already works on mod-perl2, modulo a bunch of patches to bring it up to
> date wrt the Apache2 rename.

The update to Apache::Scoreboard should go out later this week (RCs available 
if you'd like to test).

> However the entire API is read-only. Is there any way to write the
> scoreboard?

I don't see why it wouldn't be possible. It's just not exposed through the 
current Apache::Scoreboard API, as no one seems to have ever needed it. If 
you want to submit a patch to Apache::Scoreboard feel free. :) I'm not sure 
what the best approach to providing a writable API would be here. 


-- 
Anywhere is walking distance, if you've got the time.
- Steven Wright

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Scoreboard plans?

Posted by Matt Sergeant <ma...@sergeant.org>.
On 20 Jun 2005, at 17:36, Matt Sergeant wrote:

> I see in the docs there's a stub to return $c->sbh - a scoreboard 
> handle. Are there any plans to implement this any time soon?

OK, so answering my own question - looks like Apache::Scoreboard 
already works on mod-perl2, modulo a bunch of patches to bring it up to 
date wrt the Apache2 rename.

However the entire API is read-only. Is there any way to write the 
scoreboard?

Matt.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org