Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17730 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53930 invoked by uid 1010); 9 Aug 2005 19:44:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 53914 invoked from network); 9 Aug 2005 19:44:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Aug 2005 19:44:41 -0000 X-Host-Fingerprint: 80.137.30.48 p50891E30.dip0.t-ipconnect.de Received: from ([80.137.30.48:18034] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id E6/1D-04646-7A709F24 for ; Tue, 09 Aug 2005 15:44:39 -0400 To: internals@lists.php.net,steve roussey Message-ID: <42F907A0.8070900@web.de> Date: Tue, 09 Aug 2005 21:44:32 +0200 User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 References: <57792e85050808205143e96a8f@mail.gmail.com> In-Reply-To: <57792e85050808205143e96a8f@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 80.137.30.48 Subject: Re: Moving to PHP5.1 and Apache 2.2 next year, need help From: akorthaus@web.de (Andreas Korthaus) steve roussey wrote: > The setup we are striving for is to keep connections open all the way > down the chain to the database. Ideally this would mean that we would > use Apache 2.2 with the event MPM to hold user connections. Then the > PHP threads would ideally hold persistent connections to the databases > (either through using the Apache 2.1 mod_dbd or doing it in PHP > itself). Have you considered using lighttpd with fastcgi loadbalancing and caching using mod_cml (cache meta language)? We have a similar problem here, and that's how we're going to solve it: By using lighttpd with fastcgi we seperate the webserver process from php processes (which could even work on other machines) which saves a lot of resources (memory/cpu/load) and enhance response-time for static files. For simple dynamic requests we can use mod_cml, which can "communicate" with PHP using memcached or the filesystem. Only if mod_cml cannot response to the request using cached data, php is needed. That speeds things up a lot, since cache-hits in mod_cml are not much slower than static files (because php is not touched in any way). It works perfectly with keep-alive. The connections from lighttpd process to fastcgi php processes are also persistent. It's no problem to use a php opcode cache. Perhaps db-connection pooling isn't an issue anymore, because the number of php-processes (= number of db connections) can be reduced drastically. Perhaps you can use apc_store()... or memcached to cache results of DB queries. http://trac.lighttpd.net/trac/wiki/CacheMetaLanguage http://trac.lighttpd.net/trac/wiki/TutorialLighttpdAndPHP http://trac.lighttpd.net/trac/wiki/MigratingFromApache However, I don't think mod_php on a threaded webserver is a good idea, least of all for a setup under high load because of the arguments already mentioned in this thread and because most developers don't use threaded setups today. best regards, Andreas