uTools-Manuals/docs/linux/uptime.html
2019-04-21 11:50:48 +08:00

25 lines
1.8 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="uptime">uptime</h1>
<p>查看Linux系统负载信息</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>uptime命令</strong> 能够打印系统总共运行了多长时间和系统的平均负载。uptime命令可以显示的信息显示依次为现在时间、系统已经运行了多长时间、目前有多少登陆用户、系统在过去的1分钟、5分钟和15分钟内的平均负载。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">uptime(选项)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-V显示指令的版本信息。</code></pre>
<h3 id="实例">实例</h3>
<p>使用uptime命令查看系统负载</p>
<pre><code class="language-bash">[root@LinServ-1 ~]# uptime -V #显示uptime命令版本信息
procps version 3.2.7
[root@LinServ-1 ~]# uptime
15:31:30 up 127 days, 3:00, 1 user, load average: 0.00, 0.00, 0.00</code></pre>
<p><strong>显示内容说明:</strong></p>
<pre><code class="language-bash">15:31:30 //系统当前时间
up 127 days,  3:00 //主机已运行时间,时间越大,说明你的机器越稳定。
1 user //用户连接数,是总连接数而不是用户数
load average: 0.00, 0.00, 0.00 // 系统平均负载统计最近1515分钟的系统平均负载</code></pre>
<p>那么什么是系统平均负载呢? 系统平均负载是指在特定时间间隔内运行队列中的平均进程数。</p>
<p>如果每个CPU内核的当前活动进程数不大于3的话那么系统的性能是良好的。如果每个CPU内核的任务数大于5那么这台机器的性能有严重问题。</p>
<p>如果你的linux主机是1个双核CPU的话当Load Average 为6的时候说明机器已经被充分使用了。</p>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->