# Checking server load from ruby?

**URL:** <https://www.ruby-forum.com/t/checking-server-load-from-ruby/86168>\
**Category:** Ruby\
**Created:** [February 20, 2007, 11:12am UTC](https://www.ruby-forum.com/t/checking-server-load-from-ruby/86168 "2007-02-20T11:12:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 20, 2007, 11:12am UTC](https://www.ruby-forum.com/t/checking-server-load-from-ruby/86168/1 "2007-02-20T11:12:08Z")

</div>

hi -

are there any ruby library functions for checking server load and  
general system status?  
or should i just use something like `uptime` ?

tx!

## /dc

```
  David "DC" Collier

```

[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
+81 (0)80 6521 9559  
skype: callto://d3ntaku

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 20, 2007, 11:29am UTC](https://www.ruby-forum.com/t/checking-server-load-from-ruby/86168/2 "2007-02-20T11:29:12Z")

</div>

> > > sender: “dc” date: “Tue, Feb 20, 2007 at 07:11:19PM +0900” \<\<\<EOQ  
> > > hi -  
> > > Hello,

> are there any ruby library functions for checking server load and  
> general system status?  
> or should i just use something like `uptime` ?  
> I for one just use this:  
> ~\>\> irb
> 
> > File.new(’/proc/loadavg’).read  
> > =\> “0.57 0.47 0.35 1/197 1862\n”

but a quick gem search reveals a gem that might be related to this:  
~\>\> gem search -r uptime

\*\*\* REMOTE GEMS \*\*\*

sys-uptime (0.4.5, 0.4.4)  
A Ruby interface for getting system uptime information.

Cheers,  
Alex

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 21, 2007, 4:43am UTC](https://www.ruby-forum.com/t/checking-server-load-from-ruby/86168/3 "2007-02-21T04:43:44Z")

</div>

dc wrote:

> hi -
> 
> are there any ruby library functions for checking server load and  
> general system status?  
> or should i just use something like `uptime` ?  
> It depends on whether you want to lock yourself into a specific OS or  
> not. Just out of curiosity, what’s your goal here? What will you  
> application _do_ with the information?

–  
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)  
[http://borasky-research.blogspot.com/](http://borasky-research.blogspot.com/)

If God had meant for carrots to be eaten cooked, He would have given  
rabbits fire.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 21, 2007, 4:52am UTC](https://www.ruby-forum.com/t/checking-server-load-from-ruby/86168/4 "2007-02-21T04:52:45Z")

</div>

Hi David,

On Tue, 20 Feb 2007 19:11:19 +0900, dc [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> are there any ruby library functions for checking server load and  
> general system status?  
> or should i just use something like `uptime` ?

Well calling `uptime` will certainly work and maybe the most simple.  
Although, if you are looking for an API that abstracts this a bit,  
take a look at Daniel B.'s sysutils projects at:

[http://rubyforge.org/projects/sysutils](http://rubyforge.org/projects/sysutils)

Cheers,  
Zev
