From owner-freebsd-performance@FreeBSD.ORG Fri Feb 4 14:13:48 2005 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4CAF016A4CE for ; Fri, 4 Feb 2005 14:13:48 +0000 (GMT) Received: from ford.blinkenlights.nl (ford.blinkenlights.nl [213.204.211.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F4D543D45 for ; Fri, 4 Feb 2005 14:13:47 +0000 (GMT) (envelope-from sten@blinkenlights.nl) Received: from tea.blinkenlights.nl (tea.blinkenlights.nl [192.168.1.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ford.blinkenlights.nl (Postfix) with ESMTP id 707C13F294; Fri, 4 Feb 2005 15:13:45 +0100 (CET) Received: by tea.blinkenlights.nl (Postfix, from userid 101) id 12E33286; Fri, 4 Feb 2005 15:13:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by tea.blinkenlights.nl (Postfix) with ESMTP id 04CAC268; Fri, 4 Feb 2005 15:13:44 +0100 (CET) Date: Fri, 4 Feb 2005 15:13:44 +0100 (CET) From: Sten Spans To: Claus Guttesen In-Reply-To: <20050204103210.69846.qmail@web26806.mail.ukl.yahoo.com> Message-ID: References: <20050204103210.69846.qmail@web26806.mail.ukl.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed cc: Vladimir Vrzic cc: freebsd-performance@freebsd.org Subject: Re: Apache 2 on FreeBSD 5.3 X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Feb 2005 14:13:48 -0000 On Fri, 4 Feb 2005, Claus Guttesen wrote: >> On a FreeBSD 5.3 web server with a very high load, I >> recently switched >> from Apache 1.3 and PHP 4.3 to using 2.0 with the >> prefork MPM and PHP 5. >> I noticed a drop in perfomance. What is currently >> the best (in terms of >> performance) choice for Apache w/ PHP on FreeBSD? >> Which MPM should I >> use? Does worker MPM use KSE on FreeBSD 5 and does >> it perform better >> than prefork? What about perchild and threadpool? Or >> maybe I should go >> back to Apache 1.3? Are there any sysctl or kernel >> tunings that I should >> use? > > It is not recommend to use apache 2 with PHP. That's > at least what the folks at php says. We use 1.3 and > are satisfied with the performance. This could use some clarification. Some of the mpm's for apache are threaded ( worker, perchild, etc ). These require every apache module to be threadsafe. PHP itself is threadsafe but quite a few of the libraries php links to aren't. This is why the php folks have chosen a for the safe advice of apache13. They in general don't see the advantages of apache2. Which for most simple unix mod_php installs arent that apparent. > > Have you tried to set the following in > /usr/local/etc/apache/httpd.conf? > > KeepAlive Off > MaxClients (size of one process) / (avail. RAM) Buffered logs should help a bit too, apache tuning is quite a large topic, with some resource limiting and security choises thrown in as well. I run apache with php as cgi on some boxen for security reasons, and will migrate to apache2 because of the improved errorlog handling ( try print stderr "\n\n\n"; in a cgi to see the difference ). For a better answer to your questions a more detailed explanation of what you are testing will be needed. - What are you testing ( php ? static html ? is nfs involved ? ) - How are you testing ( ab, httperf ? from where ? ) - Which configuration choises ( childs, modules, memory usage, dns settings ) - etc. -- Sten Spans "There is a crack in everything, that's how the light gets in." Leonard Cohen - Anthem