Current time: 11-26-2024, 10:18 PM Hello There, Guest! (LoginRegister)


Post Reply 
How to control the MAX thread of PHP-CGI's NO.?
Author Message
jetvster Offline
Junior Member
*

Posts: 19
Joined: Jun 2009
Reputation: 0
Post: #1
How to control the MAX thread of PHP-CGI's NO.?
apache2.config
Quote:<IfModule mpm_worker_module>
StartServers 1
MaxClients 150
MinSpareThreads 20
MaxSpareThreads 70
ThreadsPerChild 25
MaxRequestsPerChild 500
ServerLimit 2
#ThreadLimit 50
</IfModule>
php5-fcgi-starter
Quote:#!/bin/sh

umask 022

PHPRC="/var/www/fcgi/XXXXX.com/php5/"

export PHPRC
PHP_FCGI_CHILDREN=2
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=500
export PHP_FCGI_MAX_REQUESTS

exec /usr/bin/php5-cgi

Quote:host:/etc/apache2/mods-enabled# ps aux |grep php |wc -l
184 mean out of control?waste about 1.5G memory,make my server too slow because of no more memory to use


Quote:host:/etc/apache2/mods-enabled# ps aux |grep apache2
root 12311 0.0 0.2 142600 8304 ? Ss 00:18 0:05 /usr/sbin/apache2 -k start
www-data 18398 0.0 0.1 142260 5980 ? S 10:25 0:00 /usr/sbin/apache2 -k start
www-data 18399 0.0 0.1 142600 6212 ? S 10:25 0:00 /usr/sbin/apache2 -k start
www-data 19978 0.5 0.3 438636 14528 ? Sl 10:49 0:01 /usr/sbin/apache2 -k start
www-data 20006 0.5 0.3 438840 14388 ? Sl 10:49 0:01 /usr/sbin/apache2 -k start
www-data 20153 0.5 0.3 437348 12648 ? Sl 10:52 0:00 /usr/sbin/apache2 -k start
www-data 20181 0.4 0.2 436504 11704 ? Sl 10:52 0:00 /usr/sbin/apache2 -k start
root 20215 0.0 0.0 5164 796 pts/2 S+ 10:53 0:00 grep apache2
host:/etc/apache2/mods-enabled# ps aux |grep apache2 |wc -l
8

i want to control the max thread of PHP-CGI and apache,i change the param ThreadsPerChild and ServerLimit of apache2.config,but it's seem nouse,any idea?
(This post was last modified: 01-25-2010 01:22 PM by jetvster.)
01-25-2010 12:53 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
How to control the MAX thread of PHP-CGI's NO.? - jetvster - 01-25-2010 12:53 PM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)