每次我通过 SSH 登录到我的服务器时,它都会向我显示一些服务器信息。IE IP 地址、交换使用情况、内存使用情况等。它闪现我的其他事情之一是系统负载。现在大部分时间系统负载数 < 0.10 但其他时候我看到它上升到 0.89(通常在启动时)。
这就引出了一个问题,系统负载可以达到多高?例如,它有可能上升到 2.00 甚至 100.00 吗?
lar*_*sks 17
这就引出了一个问题,系统负载可以达到多高?例如,它有可能上升到 2.00 甚至 100.00 吗?
绝对地。查看uptime手册页:
System load 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 unin?
terruptable 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 aver?
age 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.
Run Code Online (Sandbox Code Playgroud)
因此,如果您有许多进程等待运行(或许多进程被阻塞等待 I/O),那么您的平均负载将很高。 本文更详细地讨论了它,并提供了指向其他资源的有用链接。
在未加载的系统上,平均负载通常在 0 <= load_average <= n范围内,其中n是系统上的内核数。
我已经看到活着的系统达到了数千。负载平均是一种基于等待进程的相对度量,即为了引起内核注意并在 CPU 上获得一些时间而存在的竞争程度。如果机器被工作淹没或崩溃,这可能需要很长时间。
可接受的级别取决于机器、内核数量、使用的内核作业调度程序的类型以及您期望它执行的作业。我有一些机器在 ~10 范围内很满意,但如果达到 ~40-50 就会陷入困境。其他人在 2 时变得明显滞后,在 10 时将无法使用。
启动期间负载很高的情况并不少见,因为很多事情正在同时完成并且机器正在清盘。我认为 ~1 是一个很正常的负载,可以在桌面 Linux 启动期间达到,然后在什么都不做的情况下稳定到 ~0.1。