Tell how long the system has been running.
see also :
ps - top - w
add an example, a script, a trick and tips
What does load average mean in unix/linux?
In general it measures the number of active processes at a given
time, but the metrics used to calculate it differ on some
systems. The only article I've found that explains it fairly well
is this one.
Linux: Getting date & time of system startup
I found some commands
who -b or
last reboot | head
who gives numeric dates, while
reboot returns abbreviated day / month names.
Server uptime checker?
If all you want to do is find out if its up, write a script to
ping the server every 10 min or so. If you want something that
will actually check functionality (like delivering a web page)
"Load average" stuck on 7.0
Your numbers appear to be valid and below over-utilization. A
fully utilized system with eight cores (or CPUs) would have a
load average of 8.0. Currently the load average is at roughly
88%. This is why the system does not exhibit any performance
An idle computer has a load number of 0. Each process using or
waiting for CPU (the ready queue or run queue) increments the
load number by 1. Most UNIX systems count only processes in the
running (on CPU) or runnable (waiting for CPU) states. However,
Linux also includes processes in uninterruptible sleep states
(usually waiting for disk activity), which can lead to markedly
different results if many processes remain blocked in I/O due
to a busy or stalled I/O system. This, for example, includes
processes blocking due to an NFS server failure or to slow
media (e.g., USB 1.x storage devices). Such circumstances can
result in an elevated load average, which does not reflect an
actual increase in CPU use (but still gives an idea on how long
users have to wait).
This means that your Java threads are responsible for the load
because (guessing) most things in
are seen by the OS as IO-blocking. You can begin investigating
these processes with tools that are mentioned answers to this
How to find uptime of a linux process
ps -o "cputime=" $pid
See "Standard format specifiers" in the
= character in
-o causes the
header to be disabled.)
average load and total %CPU in top
The reason your CPU % and load average are not agreeing is
because they are two completely different values. The CPU % is
exactly that, the percentage of the CPU a process is using. The
load average is the weighted average of the processes in the run
queue over 1, 5, and 15 minutes.
If you are concerned with how much CPU you are using (are you
fully utilizing your CPU), your tally of the output of top will
work well. You can run that occasionally and record the value (or
sar, which will do that for you).
Having a high load average means you have a lot of processes in
the run queue - many processes are ready and waiting to run. High
load doesn't automatically mean a lot of CPU usage.
Wikipedia has a good article describing the load average, and the
differences between CPU load and CPU usage: http://en.wikipedia.org/wiki/Load_Average
How to find the uptime since last wake from standby
What are you using to initiate the standby?
If you can use a script, then after the line
echo -n "standby" > /proc/acpi/sleep
you could have the line
echo `date +%s` >> /var/log/wakeups.log
Or something similar. This would mean that the first thing the
machine did when it woke up was to write the current time and
date to a log file (n seconds since epoch).
tail -1 /var/log/wakeups.log would give you the
last time. You could could subtract this from the current time to
get seconds since the last wakeup.
How to track computer's uptime
You can create a script which runs uptime & dumps it into a
uptime >> uptime.log
After that setup a cron job for it. To know more about how to
create a cron job :
Create Cron Job
Or you can sign-up for an online service to do it for you :
How to find out the time Linux machine have spent in sleep
How to find the uptime since last wake from standby
"In /var/log/pm-suspend.log, look for the last line looking like
Sun Dec 16 09:30:31 CET 2012: Awake. That's your last wakeup
time. You can calculate your uptime since then the way Paul
gives a one line display of the following information. The
current time, how long the system has been running, how many
users are currently logged on, and the system load averages
for the past 1, 5, and 15 minutes.
This is the
same information contained in the header line displayed by
averages is the average number of processes that are either
in a runnable or uninterruptable state. A process in a
runnable state is either using the CPU or waiting to use the
CPU. A process in uninterruptable state is waiting for some
I/O access, eg waiting for disk. The averages are taken over
the three time intervals. Load averages are not normalized
for the number of CPUs in a system, so a load average of 1
means a single CPU system is loaded all the time while on a
4 CPU system it means it was idle 75% of the time.
display this help text
display version information and
information about who is currently logged on
Please send bug reports to procps[:at:]freelists[:dot:]org
top , utmp, w
was written by Larry
Greenfield (greenfie[:at:]gauss.rutgers[:dot:]edu) and