Re: [PHP4BETA] Zombie Proccesses at 250+ reqs/min. High load php...

From: Date: Tue, 20 Jun 2000 08:21:36 +0000
Subject: Re: [PHP4BETA] Zombie Proccesses at 250+ reqs/min. High load php...
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-16329@lists.php.net to get a copy of this message
You've left out lots of information that would help us help you. What kind of platform are you using? Is your machine designed to handle that amount of traffic, even without PHP? - For instance, if you're using Linux, you may be bumping into some kernel compile-time-defined limits. I guess other operating systems would have equivalent configuration issues. - How do you know that the PHP processes are zombies? Did you try attaching to one of the stuck processes with a debugger, or even with strace (or equivalent)? As for your questions. Generally, objects are slower than most other things in PHP. There should be no problems redirecting. Opening and closing files at high speed is not an issue, assuming you're not locking (using flock()). Some operating systems (like most versions of Linux) don't work very well at high load with flock(). You don't have to release any resources in PHP in general, and in CGI in particular. When the script terminates, the process dies, and everything it acquired is destroyed at the operating system level. Even if it weren't so - PHP automatically frees everything by itself upon shutdown. Zeev At 12:30 08/06/2000, August Zajonc wrote:
Hey folks, A site I run has begun hitting over 250 reqs/minute which is great :) What's not so great is that the PHP stuff I put together can't seem to handle the load. I'm looking for others sense of what may be going on. It is exciting to run a high traffic site using PHP, but we can't do so if PHP falls down. I'm most interested in ways in which PHP might create zombies and/or exit uncleanly. In a high load situation this can be deadly. Running PHP4.0.0 as a CGI, using something similar to the optimized version of php.ini. Sessions are enabled and used. Auto Start == true The general outline of a page load is a call to a script which includes() 3-4 files, creates a new instance of a larger class (2,000 lines or so), calls the appropriate methods on the class, exit those methods, opens a logfile and writes some auditing data. A couple of questions include: What's the overhead on creating a large class? We can certainly avoid doing so. Often times the script sends out a redirect. Any chance this blows things out of the water? Would opening and closing a log file at that rate lead to problems? Anyone else have high load problems with PHP4? We might be able to backport and do our own sessions. Do we need to make sure we call exit? Release resources? The script tends to execute in something like .3 seconds and is not long-running from that point of view. We are already planning on moving to mod_php. What concerns me is the specter that PHP is leaking resources or generating zombies which will not disappear no matter how much hardware we throw at the problem. Tips and tricks for very high load programming (going onto a million requests/day) would be appreciated. Gotchas especially within the language. We've got a ton of global statements, does that matter? You wouldn't think so but who knows? We are certainly going to throw hardware at the problem. Basically, I'd love to have PHP scale along for the ride! It's a great package. August Zajonc Please CC me if possible as my free access net connectivity is limited and it is hard to track the list directly :) ________________________________________________________
                           1stUp.com - Free the Web
Get your free Internet access at http://www.1stUp.com -- PHP 4.0 Beta Mailing List <http://www.php.net/version4/> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net For additional commands, e-mail: php4beta-help@lists.php.net To contact the list administrators, e-mail: php4beta-admin@lists.php.net
-- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.version4 (#16329) next »