You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Rodent of Unusual Size <Ke...@Golux.Com> on 2004/02/09 22:09:29 UTC

routines for fetching load average?

would anyone have any thoughts about the idea of adding an
api to obtain the system load average?  i ask because i need
it for an httpd module i'm writing, and i've now got code
for linux, freebsd, os x, sunos, and t64u..
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"Millennium hand and shrimp!"



Re: routines for fetching load average?

Posted by Thom May <th...@planetarytramp.net>.
* Ben Laurie (ben@algroup.co.uk) wrote :
> Bill Stoddard wrote:
> 
> >Rodent of Unusual Size wrote:
> >
> >>Rodent of Unusual Size wrote:
> >>
> >>
> >>>would anyone have any thoughts about the idea of adding an
> >>>api to obtain the system load average?  i ask because i need
> >>>it for an httpd module i'm writing, and i've now got code
> >>>for linux, freebsd, os x, sunos, and t64u..
> >>
> >>
> >>
> >>no thoughts, uh.
> >
> >
> >load average is nice but it seems rather specialized and it doesn't 
> >really fit anywhere in apr[-util] that I see.  load average is one 
> >performance metric; I can see where it might be useful to have a common 
> >interface for collecting all sorts of performance metrics. For example, 
> >if Apache is being used as a load balancer, you could collect 
> >performance state metrics from the servers being load balanced, feed 
> >that info back to the apache load balancer (on an HTTP response header 
> >field, via a special purpose HTTP POST request or out of band) and use 
> >it in your load balancing/routing algorithms.
> 
> Errr - mod_backhand?
> 
> > I just don't see that this has a place in apr or apr-util. Maybe a new 
> > subproject, apr-perf?
> 
> I don't follow your logic - APR is supposed to make the interface to the 
> system portable. Load average is an interface to the system. Why does it 
> need to "fit"? All it needs is support on enough platforms to be 
> considered common and someone who wants to use it.
> 
> Sounds like we have both.
> 
+1.
-Thom

Re: routines for fetching load average?

Posted by Ian Holsman <Ia...@Holsman.net>.
SE Toolkit (http://www.setoolkit.com/) holds the promise of doing this 
in a multi platform manner, but besides from some very basic things, I 
don't think there is a 1:1 mapping in what metrics a kernel/OS grabs.

The other problem with grabing performance metrics is that instant 
measurements can be misleading, your better off with a method which can 
collect them over a time period and agregate them.


have you considered running a seperate deamon/cron job which does the 
collection/aggregation for you and sticks the result into a 
file/sharedmem (ie..
critical, warning, ok) and have you module use that?

then you can get really sophisticated on your more popular systems, and
use cpu% on the machines you can't get anything else out of.

Bill Stoddard wrote:
> Ben Laurie wrote:
> 
>> Bill Stoddard wrote:
>>
>>> Rodent of Unusual Size wrote:
>>>
>>>> Rodent of Unusual Size wrote:
>>>>
>>>>
>>>>> would anyone have any thoughts about the idea of adding an
>>>>> api to obtain the system load average?  i ask because i need
>>>>> it for an httpd module i'm writing, and i've now got code
>>>>> for linux, freebsd, os x, sunos, and t64u..
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> no thoughts, uh.
>>>
>>>
>>>
>>>
>>> load average is nice but it seems rather specialized and it doesn't 
>>> really fit anywhere in apr[-util] that I see.  load average is one 
>>> performance metric; I can see where it might be useful to have a 
>>> common interface for collecting all sorts of performance metrics. For 
>>> example, if Apache is being used as a load balancer, you could 
>>> collect performance state metrics from the servers being load 
>>> balanced, feed that info back to the apache load balancer (on an HTTP 
>>> response header field, via a special purpose HTTP POST request or out 
>>> of band) and use it in your load balancing/routing algorithms.
>>
>>
>>
>> Errr - mod_backhand?
> 
> Yes,like mod_backhand. mod_backhand is a load balancer that uses 
> feedback from the server(s) it is load balancing. The types of 
> performance metrics that can be APR'ized is quite large: memory usage, 
> memory usage characteristics of specific applications, memory 
> utilization of different aspects of different applications ('aspect' as 
> in 'aspect oriented programs'), CPU usage for same, data arrival and 
> departure rates, TCP layer performance (lost packet rate, thru-put, 
> etc), application response time, relative capability of servers being 
> load balanced (ie, CPU speed, bus speed, memory access speed, etc), blah 
> blah... the list is virtually endless.
> 
> My point: The range of performance metrics that may be of interest to, 
> say, mod_backhand suggests it might be interesting to create a dedicated 
> APR subproject for these types of APIs if we can forsee now that we will 
> be adding more than just load average (count me as interested in such a 
> project). I see goodness in adding a load average API to APR. However, 
> aggressively going for a full suite of performance metric APIs would add 
> bloat to APR, most of which would not be particularly useful to the 
> majority of the APR user community.
> 
> Bill
> 


Re: routines for fetching load average?

Posted by Bill Stoddard <bi...@wstoddard.com>.
Ben Laurie wrote:

> Bill Stoddard wrote:
> 
>> Rodent of Unusual Size wrote:
>>
>>> Rodent of Unusual Size wrote:
>>>
>>>
>>>> would anyone have any thoughts about the idea of adding an
>>>> api to obtain the system load average?  i ask because i need
>>>> it for an httpd module i'm writing, and i've now got code
>>>> for linux, freebsd, os x, sunos, and t64u..
>>>
>>>
>>>
>>>
>>> no thoughts, uh.
>>
>>
>>
>> load average is nice but it seems rather specialized and it doesn't 
>> really fit anywhere in apr[-util] that I see.  load average is one 
>> performance metric; I can see where it might be useful to have a 
>> common interface for collecting all sorts of performance metrics. For 
>> example, if Apache is being used as a load balancer, you could collect 
>> performance state metrics from the servers being load balanced, feed 
>> that info back to the apache load balancer (on an HTTP response header 
>> field, via a special purpose HTTP POST request or out of band) and use 
>> it in your load balancing/routing algorithms.
> 
> 
> Errr - mod_backhand?
Yes,like mod_backhand. mod_backhand is a load balancer that uses feedback from the server(s) it is load 
balancing. The types of performance metrics that can be APR'ized is quite large: memory usage, memory usage 
characteristics of specific applications, memory utilization of different aspects of different applications 
('aspect' as in 'aspect oriented programs'), CPU usage for same, data arrival and departure rates, TCP layer 
performance (lost packet rate, thru-put, etc), application response time, relative capability of servers being 
load balanced (ie, CPU speed, bus speed, memory access speed, etc), blah blah... the list is virtually endless.

My point: The range of performance metrics that may be of interest to, say, mod_backhand suggests it might be 
interesting to create a dedicated APR subproject for these types of APIs if we can forsee now that we will be 
adding more than just load average (count me as interested in such a project). I see goodness in adding a load 
average API to APR. However, aggressively going for a full suite of performance metric APIs would add bloat to 
APR, most of which would not be particularly useful to the majority of the APR user community.

Bill

Re: routines for fetching load average?

Posted by Ben Laurie <be...@algroup.co.uk>.
Bill Stoddard wrote:

> Rodent of Unusual Size wrote:
> 
>> Rodent of Unusual Size wrote:
>>
>>
>>> would anyone have any thoughts about the idea of adding an
>>> api to obtain the system load average?  i ask because i need
>>> it for an httpd module i'm writing, and i've now got code
>>> for linux, freebsd, os x, sunos, and t64u..
>>
>>
>>
>> no thoughts, uh.
> 
> 
> load average is nice but it seems rather specialized and it doesn't 
> really fit anywhere in apr[-util] that I see.  load average is one 
> performance metric; I can see where it might be useful to have a common 
> interface for collecting all sorts of performance metrics. For example, 
> if Apache is being used as a load balancer, you could collect 
> performance state metrics from the servers being load balanced, feed 
> that info back to the apache load balancer (on an HTTP response header 
> field, via a special purpose HTTP POST request or out of band) and use 
> it in your load balancing/routing algorithms.

Errr - mod_backhand?

>  I just don't see that this has a place in apr or apr-util. Maybe a new subproject, apr-perf?

I don't follow your logic - APR is supposed to make the interface to the 
system portable. Load average is an interface to the system. Why does it 
need to "fit"? All it needs is support on enough platforms to be 
considered common and someone who wants to use it.

Sounds like we have both.

Are you seriously suggesting APR should only support things that are 
obvious extensions of what it already does?

Cheers,

Ben.

-- 
http://www.apache-ssl.org/ben.html       http://www.thebunker.net/

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff

Re: routines for fetching load average?

Posted by Bill Stoddard <bi...@wstoddard.com>.
Rodent of Unusual Size wrote:

> Rodent of Unusual Size wrote:
> 
> 
>>would anyone have any thoughts about the idea of adding an
>>api to obtain the system load average?  i ask because i need
>>it for an httpd module i'm writing, and i've now got code
>>for linux, freebsd, os x, sunos, and t64u..
> 
> 
> no thoughts, uh.

load average is nice but it seems rather specialized and it doesn't really fit anywhere in apr[-util] that I 
see.  load average is one performance metric; I can see where it might be useful to have a common interface 
for collecting all sorts of performance metrics. For example, if Apache is being used as a load balancer, you 
could collect performance state metrics from the servers being load balanced, feed that info back to the 
apache load balancer (on an HTTP response header field, via a special purpose HTTP POST request or out of 
band) and use it in your load balancing/routing algorithms.  I just don't see that this has a place in apr or 
apr-util. Maybe a new subproject, apr-perf?

Bill

Re: routines for fetching load average?

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Rodent of Unusual Size wrote:

> would anyone have any thoughts about the idea of adding an
> api to obtain the system load average?  i ask because i need
> it for an httpd module i'm writing, and i've now got code
> for linux, freebsd, os x, sunos, and t64u..

no thoughts, uh.
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"Millennium hand and shrimp!"


Re: routines for fetching load average?

Posted by Ben Laurie <be...@algroup.co.uk>.
Rodent of Unusual Size wrote:

> would anyone have any thoughts about the idea of adding an
> api to obtain the system load average?  i ask because i need
> it for an httpd module i'm writing, and i've now got code
> for linux, freebsd, os x, sunos, and t64u..

Sounds like a plan to me, go for it!

Cheers,

Ben.

-- 
http://www.apache-ssl.org/ben.html       http://www.thebunker.net/

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff

Re: routines for fetching load average?

Posted by Mads Toftum <ma...@toftum.dk>.
On Mon, Feb 09, 2004 at 04:09:29PM -0500, Rodent of Unusual Size wrote:
> would anyone have any thoughts about the idea of adding an
> api to obtain the system load average?  i ask because i need
> it for an httpd module i'm writing, and i've now got code
> for linux, freebsd, os x, sunos, and t64u..
                                                                                              
I could definetely see this being useful - two examples that comes to
mind are for some rudimentary dos evasive actions and the other would
be to turn off modules like mod_deflate in high load situation.
Another thing that might be useful is a mem free check.

vh
                                                                                              
Mads Toftum
--
`Darn it, who spiked my coffee with water?!' - lwall