From owner-freebsd-questions@FreeBSD.ORG Sun Oct 31 12:19:25 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 28F3016A4CE for ; Sun, 31 Oct 2004 12:19:25 +0000 (GMT) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id BF82843D4C for ; Sun, 31 Oct 2004 12:19:24 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from [192.168.1.3] (pool-68-160-246-51.ny325.east.verizon.net [68.160.246.51]) by pi.codefab.com (8.12.11/8.12.11) with ESMTP id i9VCJ45L093700 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 31 Oct 2004 07:19:07 -0500 (EST) Message-ID: <4184D833.9020801@mac.com> Date: Sun, 31 Oct 2004 07:18:59 -0500 From: Chuck Swiger Organization: The Courts of Chaos User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Omer Faruk Sen References: <20041031114514.19687.qmail@istanbul.enderunix.org> In-Reply-To: <20041031114514.19687.qmail@istanbul.enderunix.org> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-4.0 required=5.5 tests=AWL,BAYES_00 autolearn=ham version=2.64 X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on pi.codefab.com cc: freebsd-questions@freebsd.org Subject: Re: mysql and system/nice cpu usage X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2004 12:19:25 -0000 Omer Faruk Sen wrote: > I have web server which uses php+mysql. As far as I have searched the > best thing to use mysql on FreeBSD is to use linuxthreads. [ ... ] > 240 processes: 7 running, 233 sleeping > CPU states: 10.9% user, 73.9% nice, 12.5% system, 2.7% interrupt, 0.0% > idle > Mem: 244M Active, 1309M Inact, 309M Wired, 93M Cache, 199M Buf, 56M Free > Swap: 3072M Total, 24K Used, 3072M Free Well, you've managed to saturate the available CPU power with the workload. If you've already done some performance tuning at the FreeBSD level by adjusting your kernel config and followed "man tuning", you aren't likely to get much further by tweaking FreeBSD's config. Look into optimizing your database utilization by checking the SQL query histogram, particularly if your site ends up doing transaction(s) for each HTTP hit. People write books on database management and tuning, and you should look there rather than to a FreeBSD list for advice. :-) You could also get another machine and run the database and webserver on seperate systems to help site performance by dividing and concentrating the workload. Consider switching from MySQL to postgres or a database you actually pay for: Oracle, Sybase, Frontbase, etc. You could also consider another web middleware/scripting evironment than PHP which handles database interactions more efficiently: Zope, JSP, WebObjects. -- -Chuck