From owner-freebsd-performance@FreeBSD.ORG Sat Jan 26 11:12:53 2008 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FA4616A420 for ; Sat, 26 Jan 2008 11:12:53 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from mail.sweeplist.com (mail.sweeplist.com [77.93.199.51]) by mx1.freebsd.org (Postfix) with ESMTP id EA40113C448 for ; Sat, 26 Jan 2008 11:12:52 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from [192.168.1.2] (r3a200.net.upc.cz [213.220.192.200]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sweeplist.com (Postfix) with ESMTPSA id C2BB167808 for ; Sat, 26 Jan 2008 11:55:24 +0100 (CET) Message-ID: <479B1185.8020604@quip.cz> Date: Sat, 26 Jan 2008 11:55:01 +0100 From: Miroslav Lachman <000.fbsd@quip.cz> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: cz, cs, en, en-us MIME-Version: 1.0 To: freebsd-performance@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: PHP with open_basedir performance problem X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2008 11:12:53 -0000 Hi all, I found a painful performance problem with Apache + PHP 5 when open_basedir directive is enabled. Application performance drops by more than 50% with open_basedir enabled. There is also significant disproportion between usr / sys CPU load. (sys is much higher than usr) I do not know if this is problem on FreeBSD side or in PHP code itself. This problem exists on FreeBSD 6 and 7 (maybe older versions too - I did not check). I tested both shedulers on FreeBSD 7, no big difference (application performance is little better with 4BSD). Is there anyone with enough knowledge and time to look at it? This problem affects Mac OS X as well, but does not seem to appear on Linux. http://lists.apple.com/archives/macos-x-server/2006/Nov/msg00623.html Application workload - tested by http_load (on dual Xeon 3GHz!) with open_basedir: 11.5403 fetches/sec without open_basedir: 4.53845 fetches/sec Synthetic test: ## with open_basedir CPU states: 17.5% user, 0.0% nice, 82.3% system, 0.2% interrupt, 0.0% idle # http_load -parallel 10 -fetches 1000 load.urls 1000 fetches, 10 max parallel, 2000 bytes, in 29.3449 seconds 2 mean bytes/connection 34.0775 fetches/sec, 68.155 bytes/sec msecs/connect: 0.302057 mean, 0.441 max, 0.156 min msecs/first-response: 292.693 mean, 525.471 max, 159.389 min HTTP response codes: code 200 -- 1000 ## without open_basedir CPU states: 54.0% user, 0.0% nice, 45.2% system, 0.8% interrupt, 0.0% idle http_load -parallel 10 -fetches 1000 load.urls 1000 fetches, 10 max parallel, 2000 bytes, in 4.47231 seconds 2 mean bytes/connection 223.598 fetches/sec, 447.196 bytes/sec msecs/connect: 0.297157 mean, 0.442 max, 0.153 min msecs/first-response: 44.3433 mean, 157.334 max, 8.044 min HTTP response codes: code 200 -- 1000 Simple testcase: ---- content of index.php ---- ---- content of whatever.php ---- http_load is instructed to do 1000 fetches of index.php in 10 parallel connections. Miroslav Lachman