Wishlist 0 ¥0.00

FastCGI模式下PHP占用大量内存的解决办法

解决这个问题的办法是在Wb服务器配置中降低PHP_FCGI MAX REQUESTS的值。
这个参数决定了一个php-cgi进程被创建出来之后,最多接受的PHP请求数,在lighttpd中默认配置是10000。
也就是说这个php-cg进程每接受10000次PHP请求后会终止,释放所有内存,并重新被管理进程启动。
如果把它降低,比如改成100,那么pp-cg重启的周期会大大缩短,偶然的高内存操作造成的问题影响时间也会缩短。
另一个办法则是写一个crontab脚本,定时发现高内存占用的php-cgi进程并向它传送kil指令。

About Us

Since 1996, our company has been focusing on domain name registration, web hosting, server hosting, website construction, e-commerce and other Internet services, and constantly practicing the concept of "providing enterprise-level solutions and providing personalized service support". As a Dell Authorized Solution Provider, we also provide hardware product solutions associated with the company's services.
 

Contact Us

Address: No. 2, Jingwu Road, Zhengzhou City, Henan Province

Phone: 0086-371-63520088 

QQ:76257322

Website: 800188.com

E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.