Tuesday, February 18, 2014

Apache Memory管理:Prefork and Worker

這幾日觀察提供數種服務的Linode server上,各個process使用資源的情況,發現一個apache的child process約需要20MB的memory,若是沒有多加管控,容易超出linux的memory上限,觸發OOM,部分process會被作業系統kill。

"It is not unheard of for even small to moderate sized Python web applications to consume 30MB or more of private memory in each child server process." -- from this reference

  • prefork:一個request(task)由其中一個apache process負責
  • worker:一個request(task)由多個apache process負擔

"If you use mod_wsgi daemon mode, it doesn't matter which Apache MPM you use, although suggested that for UNIX systems worker MPM be used unless you are stuck with having to also host PHP applications using mod_php as some PHP extensions aren't thread safe." -- from this reference

No comments:

Post a Comment