關於cpulimit 的問題 - Linux

Table of Contents

我想要用cpulimit 去限制我的httpd 最多只能使用20%的cpu
指令 # cpulimit -e httpd -l 20
但我用top 去看我的httpd服務還是可以到100%
我發現cpulimit 抓到的pid都是錯的 跟httpd目前所使用的pid都不一樣
有人知道怎麼解決嗎

--

∬鷼鷼鷼鷼鷼∬
╭╦╦╦╮
║║╭╯
║║║╮
╰╰╰╯

--

All Comments

Jacky avatarJacky2016-01-02
http 服務一般是請求完成之後,若沒有 keep alive 的話
Lily avatarLily2016-01-04
後續連線中斷之後 process 大多結束,除非 apache
有開 keep alive 然後 client 也使用 keep alive,
Genevieve avatarGenevieve2016-01-06
那還要看 apache 有設定允許每個請求處理幾次後才結束
該 child process. 簡單說 apache fork 產生的 child
process 會伴隨連線後續可能結束,主要 apache 會重新
Joe avatarJoe2016-01-09
fork 新的 child process 提供連線存取
Blanche avatarBlanche2016-01-09
使用 -e 參數可能還要另外追一下 cpulimit source code
看他對於 process name 判斷處理方式
Joe avatarJoe2016-01-13
畢竟 apache 啟動後 fork 一堆 prcoess name 都相同的
那就會比較難追問題
Tom avatarTom2016-01-14
建議使用systemd來限制