日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > linux >内容正文

linux

linux中top和ps的内存区别,linux - top与ps间的区别

發(fā)布時(shí)間:2024/9/27 linux 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux中top和ps的内存区别,linux - top与ps间的区别 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

背景

在linux系統(tǒng)中提供了2個(gè)查詢系統(tǒng)負(fù)荷值的命令,一個(gè)是 ps -o THREAD 一個(gè)是 top ,這兩個(gè)命令都能夠查詢當(dāng)前進(jìn)程的CPU使用率情況,但是所代表的含義確實(shí)不一樣的,ps -o THREAD 偏向與整個(gè)進(jìn)程周期所占的CPU使用率,而 top 更偏向于某個(gè)固定時(shí)間窗口的CPU使用率也就是說(shuō)更傾向于查詢實(shí)時(shí)CPU使用率。

具體

NOTES

This ps works by reading the virtual files in /proc. This ps does not need to be setuid kmem or have any privileges to run. Do not give this ps any special permissions.

This ps needs access to namelist data for proper WCHAN display. For kernels prior to 2.6, the System.map file must be installed.

CPU usage is currently expressed as the percentage of time spent running during the entire lifetime of a process. This is not ideal, and it does not conform to the

standards that ps otherwise conforms to. CPU usage is unlikely to add up to exactly 100%.

從第三行 CPU usage is currently expressed as the percentage of time spent running during the entire lifetime of a process 可知 CPU使用率表示為進(jìn)程整個(gè)生命周期中 與 運(yùn)行在CPU上所花費(fèi)的時(shí)間 百分比

1. %CPU -- CPU Usage

The task's share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time.

In a true SMP environment, if a process is multi-threaded and top is not operating in Threads mode, amounts greater than 100% may be reported. You toggle Threads mode

with the `H' interactive command.

根據(jù) CPU Usage The task's share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time.知道CPU使用率是在一個(gè)單位時(shí)間窗口下該進(jìn)程占用CPU時(shí)間與該單位時(shí)間的百分比值。

總結(jié)

ps -o THREAD 命令更偏向于整個(gè)進(jìn)程生命中占用CPU時(shí)間的比率。

top 命令更偏向于某個(gè)時(shí)間點(diǎn)占用CPU時(shí)間的比率。

總結(jié)

以上是生活随笔為你收集整理的linux中top和ps的内存区别,linux - top与ps间的区别的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。