看板 Linux 關於我們 聯絡資訊
我想要用cpulimit 去限制我的httpd 最多只能使用20%的cpu 指令 # cpulimit -e httpd -l 20 但我用top 去看我的httpd服務還是可以到100% 我發現cpulimit 抓到的pid都是錯的 跟httpd目前所使用的pid都不一樣 有人知道怎麼解決嗎 -- ∬鷼鷼鷼鷼鷼∬ ╭╦╦╦╮ ║║╭╯ ║║║╮ ╰╰╰╯ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 203.70.208.14 ※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1451381527.A.4D1.html
kenduest: http 服務一般是請求完成之後,若沒有 keep alive 的話 12/29 21:22
kenduest: 後續連線中斷之後 process 大多結束,除非 apache 12/29 21:23
kenduest: 有開 keep alive 然後 client 也使用 keep alive, 12/29 21:23
kenduest: 那還要看 apache 有設定允許每個請求處理幾次後才結束 12/29 21:25
kenduest: 該 child process. 簡單說 apache fork 產生的 child 12/29 21:25
kenduest: process 會伴隨連線後續可能結束,主要 apache 會重新 12/29 21:25
kenduest: fork 新的 child process 提供連線存取 12/29 21:26
kenduest: 使用 -e 參數可能還要另外追一下 cpulimit source code 12/29 21:28
kenduest: 看他對於 process name 判斷處理方式 12/29 21:28
kenduest: 畢竟 apache 啟動後 fork 一堆 prcoess name 都相同的 12/29 21:29
kenduest: 那就會比較難追問題 12/29 21:29
hizuki: 建議使用systemd來限制 12/31 04:17