Results 1 to 8 of 8

Thread: How to limit Number of PHP processes on w/ mod_fcgid

  1. #1
    Join Date
    Mar 2010
    Posts
    576

    How to limit Number of PHP processes on w/ mod_fcgid

    Does anybody be familiar with how to limit the number of PHP procedure allowed when using mod_fcgid. What I would love to be capable to do, and would assist enormously with the occasional server smash into when a user gets slammed, is to be capable to limit this. Somehow say "once a user has 4 PHP-CGI's working, no additional for that user. I am happy by means of this being a single, server wide setting. Right at present I am using mod_fcgid. I do not desire it to be "total per server" as that means one user might suck up the entire free slots and no one gets several additional. I would similar to be capable to say "every user in the server gets up to (3,4,5) and if any user hits that number of PHP-CGI procedure working, they do not get several additional" The way it is now it's probable a user gets creamed and then the entire the sudden they end up by means of 20 PHP's working and sucking up 1 GB or 2 which makes the server discontented.

  2. #2
    Join Date
    Apr 2009
    Posts
    569

    Re: How to limit Number of PHP processes on w/ mod_fcgid

    I saw your placement here at the same time as setting up a comparable arrangement by means of a test server and searching for the similar respond. I encompass Apache 2.2 by means of worker MPM, and configured PHP for fcgi handling. I installed a uncomplicated wordpress blog by means of some youtube videos linked, and then slammed it by means of ab (apache benchmark) to simulate a ton of concurrent requests.

  3. #3
    Join Date
    May 2009
    Posts
    529

    Re: How to limit Number of PHP processes on w/ mod_fcgid

    I was in the beginning working the ab tool at the same time as trying to use mod_bw to limit instantaneous connections and return a 503 error, but that did not seem to run. The DefaultMaxClassProcessCount 5 alternative is the winner in my testing so far. This means 1000 requirements by means of 30 simultaneous connections. Originally, Apache/FastCGI would spawn regarding 20 php5 processes and the system load would shoot up. Limiting to 5 on top of kept the number of php5 processes to 5.

  4. #4
    Join Date
    May 2009
    Posts
    637

    Re: How to limit Number of PHP processes on w/ mod_fcgid

    I set DefaultMaxClassProcessCount to 10, but when I utilize ab by means of similar parameters it spawns up to 34 procedures. System load shoots up and the whole thing slows down. Where did you add DefaultMaxClassProcessCount 10. Did you start again Apache. I located the directive (for testing merely) in /usr/local/apache/conf/php.conf. To maintain it everlastingly, you would necessitate it in pre_virtualhost_global.conf, in view of the fact that that's loaded after php.conf but previous to the virtual hosts are.

  5. #5
    Join Date
    May 2009
    Posts
    543

    Re: How to limit Number of PHP processes on w/ mod_fcgid

    I completed my changes in /usr/local/apache/conf/php.conf and restarted apache. It seems that the entire additional settings are running. I checkered it multiple times, no typo or additional tribulations. Funny is, that error_log said 10/10 procedure reached, stopping spawning. Is my server spawning to speedy. I had a number of subdomains on the similar account by means of old starter script, so they continued spawning.

  6. #6
    Join Date
    Jun 2010
    Posts
    3

    Re: How to limit Number of PHP processes on w/ mod_fcgid

    It can be lot of changes can be able to do with PHP and check multiple times from the domains and also you have to config the file from PHP that can be requires lot of continuing procedure from the PHP .

  7. #7
    Join Date
    Aug 2009
    Posts
    750

    Re: How to limit Number of PHP processes on w/ mod_fcgid

    If the error_log is presentation that it's merely spawning 10 procedures, then it sounds similar to its running correctly. You be able to create certain this by working top on the server and counting the numeral of php procedure when working ab from your client apparatus, or by working something similar to ps aux | grep php or ps aux | grep php | wc -l when you are working ab. You might necessitate filtering on your test username as well: ps aux | grep php | grep username.

  8. #8
    Join Date
    Aug 2009
    Posts
    652

    Re: How to limit Number of PHP processes on w/ mod_fcgid

    I was preliminary concerned regarding this but it presently did not create sense, so I did some testing. I had 16 (max) procedures the entire being used by one account, then completed a request by means of an additional account, and 1 or additional of the procedures went to the innovative account. So I imagine it must free them up as necessary. At present those innovative procedures that were owned by the first account, might encompass been idle and so you capable to be free would up, that I do not be familiar with. But it tranquil does not create sense that one user might hog the entire the procedures. I presently do not be familiar by means of sufficient regarding the internal workings to say.

Similar Threads

  1. Replies: 4
    Last Post: 01-02-2011, 01:43 PM
  2. How to decrease number of processes running in windows 7
    By Sheridan^OS in forum Networking & Security
    Replies: 4
    Last Post: 13-12-2010, 03:42 PM
  3. How to limit upload limit for each torrent
    By Asclepius in forum Technology & Internet
    Replies: 6
    Last Post: 18-06-2010, 05:05 AM
  4. Limit of number of users in linux
    By LinuxeD in forum Operating Systems
    Replies: 3
    Last Post: 06-08-2009, 11:58 PM
  5. Install PHP5 On Fedora 10 and Apache2 with mod_fcgid
    By mauricio in forum Guides & Tutorials
    Replies: 5
    Last Post: 16-03-2009, 10:35 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,750,627,036.09695 seconds with 16 queries