Re: vmstat -s "boot time" Redhat Linux

  • From: Yong Huang <yong321@xxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Sat, 14 Nov 2009 09:11:40 -0800 (PST)

> That is the actual time in seconds since the epoch (unix time) that the
> machine was started.  It's stored in /proc/stat, and vmstat just grabs the
> raw value and displays it with a slightly better label (it's btime in
> /proc/stat).

Matthew is right. On Linux, `who -b' shows the time the system came up:

$ who -b
         system boot  2009-10-19 16:53

You can use this to verify (month starts with 0):

$ perl -e 'use Time::Local; print timelocal(0, 53, 16, 19, 9, 2009)'
1255989180$
$
$ vmstat -s | grep boot
   1255989111 boot time

I got 69 seconds' difference mostly because (I think) /var/run/utmp 
has a slightly different bootup time than /proc/stat. That is, /proc/stat 
is populated earlier than /var/run/utmp. The difference would be larger 
if I assumed a non-zero second in my Perl one-liner for the time given by 
`who -b'.

Yong Huang


      
--
//www.freelists.org/webpage/oracle-l


Other related posts: