歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Unix知識 >> Unix教程 >> SGI IRIX操作系統系統管理員培訓資料(六)

SGI IRIX操作系統系統管理員培訓資料(六)

日期:2017/2/27 17:40:54   编辑:Unix教程
系統管理員IRIX

4.6 監測用戶
查看哪些用戶正在使用你的系統,主要命令:
l w what users are logged in and for how long?
l who users, ports, login times
l whodo users, ports, login times, commands
l finger detailed user information
l last login history by userid or tty port
l /var/adm/sulog history of switch user command usage
4.6.1. w,who,whodo,finger,finger -l,last
查看哪些用戶登錄了你的系統。
命令:
#(%) w
#(%) who
#(%) whodo
#(%) finger
注:使用了/etc/passwd的GECOS字段以提供額外信息。
#(%) finger -l
#(%) last jwag
注:從/etc/wtmp中根據用戶ID和tty端口過濾出來的該用戶以前的登錄信息。
4.6.2. /var/adm/sulog
查看su (switch user command usage)的登錄成功與否(+/-);
# tail /var/adm/sulog
注:只有root和adm權限才能查看sulog
# ls -l /var/adm/sulog
4.7 進程管理
至此我們已經了解了如何去查看“系統正在運行什麼”的命令,那麼,下一步,我們該做那些事情來對現有的系統資源進行操作?
4.7.1. 調整一個“慢速”系統
若你的用戶抱怨他/她的機器運行速度比正常的慢,那麼你就應該采用上文講到的系統監測工具來查看哪個進程占用了大量的系統資源。
1,用top命令來查詢大量侵占CPU的進程;
2,你應幫助用戶裁決他/她的進程之所以大量侵占CPU時間的原因。
4.7.2. “殺死”一個進程
命令格式:
# kill –signalnumber processIDnumber
signalnumber主要有:
# kill PID
# kill –01 PID ;hangup
# kill –02 PID ;interrupt
# kill –03 PID ;quit
# kill –05 PID ;trace trap(not set when caught)
# kill –06 PID ;abort
# kill –09 PID ;Kill (cannot be caught or ignored)
# kill –10 PID ;bus error
# kill –11 PID ;segmentation violation
# kill –12 PID ;bad argment to system call
# kill –15 PID ;software termination signal(default)
4.7.3. 操作進程的調度優先級
IRIX操作系統允許系統管理員對進程的優先級進行多項操作,你能控制:
l 按何種序列(what order)將進程規劃到CPU;
l 進程在CPU中運行多長時間(how long);
l 進程使用CPU的頻率(how often)
進程規劃屬性可按下述方式更改:
l NDPRI set or remove non-degrading priority
l RENICE relative “nice-ness” value
l SLICE size of process’s time slice in the cpu
l DEADLINE periodic deadline scheduling (uew IRIX feature)
see: #man schedctl 以獲取細節信息。
note: System and Program tuning is covered in detail in the Advanced System Administration and Real Time workshops.
操作進程的規劃優先級命令:
所有進程的優先級之值都可由內核來設置,優先級之值特點:
l range from 0~254
l are banded into subranges
l have meaning relative to other process’s priorities
l may change over time (degrade or upgrade)
命令:
命令 更改類型
Npri absolute or relative,set non-degrading, time slice, deadline schduling.A super-user can use npri to change the priority of a user’s process.one could change the:priority, making it non-degrading {-h}absolute ‘nice-ness’ value {-n}time slice for the process {-t}
Nice relative modifier, regular users can lower their priority.changes the priority of a time-sharing process.giving your processes a lower scheduling priority.Two kinds of nice command:build into the c-shell (/bin/csh)called from other types of shells - /sbin/niceExample:% nice -10 ls

下面來回答4.7.1的問題。即:
問題:
1. pat(一個用戶)的進程侵占了大量的系統資源;
2. pat本人不原意nice他/她的進程,也不想在晚上工作;
3. 許多其他用戶又必須完成其工作。

超級用戶就應立刻進行拯救!
1. 用ps查看pat進程的PID號;
2. 用npri更改pat進程的優先到254(最低優先級)
# npri -h 254 -p <PID>
這樣pat的進程仍能運行,但只能在系統不忙時方可。
# ps -el查看更改後進程狀況。
4.8 監測IRIX系統小節
l 理解IRIX進程
什麼是進程,我們為什麼要關心進程是如何工作的?
l 監測系統行為
我們能用哪些工具來監測我們的系統?
l 監測用戶
我們能用哪些工具來查看我們的用戶在做些什麼?
l 管理進程
我們能對系統作哪些操作來確保系統高效運作?

Copyright © Linux教程網 All Rights Reserved