试图追查一些高服务器负载的原因。
不知道这是否与它有任何关系,但在进程pipe理器中,我注意到有大约200个正在运行的进程:/ usr / local / apache / bin / httpd -k start -DSSL
每个使用大约7.6%的内存。
我知道httpd是Apache,但究竟是什么过程?
有任何想法吗?
Apache MPM-Prefork为每个连接启动一个新的进程。 这听起来效率很低,但不幸的是完全正常。
我从来没有使用MPM-Prefork运行Apache,这是为了便于pipe理的默认设置。
Apache还有另外两个MPM,MPM-Worker和MPM-Event。 Worker是multithreading的,Event是asynchronous的。
我更喜欢工人,因为它更成熟,国际海事组织仍然提供更好的performance。 有些喜欢事件,否则说。 无论哪种方式更好,然后每次分叉一个进程。
PHP是默认的非线程安全的,有人会说不pipe什么非线程安全的! 所以你不能使用普通的mod_php和MPM-Prefork以外的东西。
但是,您可以使用MPM-Worker并使用FastCGI为PHP提供服务。 我更喜欢通过PHP-FPM来做FastCGI,但是使用Cpanel通过mod_fcgi很容易。
你应该用easyapache脚本重新编译apache。 在运行easyapache之前更新您的Cpanel。
一定要selectapache 2.2,PHP 5,MPM-Worker,FastCGI,suEXEC
我也selectSuhosin作为安全性,以及eaccelerator / Zend性能优化器。
一旦构build完成,你会得到一个菜单,select如何服务的PHP,selectfcgi!
在这里阅读更多http://docs.cpanel.net/twiki/bin/view/EasyApache3/ApachePHPRequestHandling
…或处理糟糕的performance。