程式執行優先順序--Priority與Nice值

來源:互聯網
上載者:User

程式執行優先順序--Priority與Nice值 1、關係概念:Priority即PRI值。此值核心控制,改不了的Nice可以改,關係:PRI(new) = PRI(old) + nice  www.2cto.com  2、Nice調整限制:nice 值可調整的範圍為 -20 ~ 19 ; root 可隨意調整自己或他人程式的 Nice 值,且範圍為 -20 ~ 19 ; 一般使用者僅可調整自己程式的 Nice 值,且範圍僅為 0 ~ 19 (避免一般使用者搶佔系統資源); 一般使用者僅可將 nice 值越調越高,例如本來 nice 為 5 ,則未來僅能調整到大於 5; 3、調整方法一:新執行的指令即給予新的 nice 值[root@www ~]# nice [-n 數字] command選項與參數:-n  :後面接一個數值,數值的範圍 -20 ~ 19。  www.2cto.com  用ps -l查的話,裡面顯示的PRI就是PRI(new),核心會自動調整,不是PRI(old) + nice的值,會調高一點點 4、調整方法二:已存在程式的 nice 重新調整renice [number] PID 5、調整方法三:top

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.