原Linux命令詳解之w命令
LittleLawson閱讀數(shù):8512018-10-29
▍ 聲明:如有侵權(quán),請(qǐng)及時(shí)與我們聯(lián)系,如有轉(zhuǎn)載,請(qǐng)聯(lián)系并注明原出處。聲明:本文可以不經(jīng)作者同意任意轉(zhuǎn)載,但任何對(duì)本文的引用都須注明作者、出處及此聲明信息。商業(yè)轉(zhuǎn)載請(qǐng)聯(lián)系作者獲得授權(quán),非商業(yè)轉(zhuǎn)載請(qǐng)注明出處。
···
NAME
w - Show who is logged on and what they are doing.
w命令就是用來展示誰在登錄,以及他們?cè)谧鍪裁础?/p>
DESCRIPTION
w displays information about the users currently on the machine, and their processes. The header shows, in this order, 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.
The following entries are displayed for each user: login name, the tty name, the remote host, login time, idle time, JCPU, PCPU, and the command line of their current process.
The JCPU time is the time used by all processes attached to the tty. It does not include past background jobs, but does include currently running background jobs.
The PCPU time is the time used by the current process, named in the "what" field.
-----當(dāng)前時(shí)間,系統(tǒng)啟動(dòng)到現(xiàn)在的時(shí)間,登錄用戶的數(shù)目,系統(tǒng)在最近1秒、5秒和15秒的平均負(fù)載。通過查看【進(jìn)程綜合信息】用戶可以了解系統(tǒng)當(dāng)前進(jìn)程的運(yùn)行狀況,并可自行分析判斷系統(tǒng)中的可疑進(jìn)程,中止進(jìn)程。在做第一步的時(shí)候,系統(tǒng)當(dāng)前的php fastcgi進(jìn)程數(shù)明顯超過了預(yù)設(shè)值的64這個(gè)數(shù)值,在電信的服務(wù)器上查看當(dāng)前的php fastcgi進(jìn)程數(shù)沒有高于64這個(gè)數(shù)值,而且網(wǎng)通線路的活動(dòng)連接明顯高于電信的活動(dòng)連接linux命令,準(zhǔn)備到晚上的時(shí)候看看情況,結(jié)果到晚上22:30的時(shí)候,查看系統(tǒng)當(dāng)前的php fastcgi進(jìn)程數(shù)明顯小于64預(yù)設(shè)值,當(dāng)前的活動(dòng)連接也比原來低很多,由此可以說明出現(xiàn)nginx不穩(wěn)定的情況是由于服務(wù)器訪問負(fù)載過大引起的,就是加上第二步的錯(cuò)誤也不頂作用。
接下來的條目展示每個(gè)用戶:登錄名,tty 名linux命令,遠(yuǎn)程的(登錄)主機(jī),登錄時(shí)間,空閑時(shí)間,JCPU,PCPU,以及當(dāng)前進(jìn)程的命令行。
JCPU時(shí)間是附加到所有的進(jìn)程的使用時(shí)間。它不包括過去的后臺(tái)程序,但是包括當(dāng)前正在運(yùn)行的后臺(tái)程序。【不太理解】
PCPU時(shí)間是當(dāng)前線程使用的時(shí)間,并在what域中展示出來。