From owner-freebsd-questions@FreeBSD.ORG Thu Nov 22 14:52:15 2007 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7777416A418; Thu, 22 Nov 2007 14:52:15 +0000 (UTC) (envelope-from jhary@unsane.co.uk) Received: from unsane.co.uk (unsane-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:1f1::2]) by mx1.freebsd.org (Postfix) with ESMTP id C4AF013C465; Thu, 22 Nov 2007 14:52:14 +0000 (UTC) (envelope-from jhary@unsane.co.uk) Received: from prawn.unsane.co.uk (150.117-84-212.staticip.namesco.net [212.84.117.150]) (authenticated bits=0) by unsane.co.uk (8.14.0/8.14.0) with ESMTP id lAMEpetR009087 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Nov 2007 14:51:42 GMT (envelope-from jhary@unsane.co.uk) Message-ID: <47459796.8090006@unsane.co.uk> Date: Thu, 22 Nov 2007 14:52:06 +0000 From: Vince User-Agent: Thunderbird 2.0.0.9 (X11/20071116) MIME-Version: 1.0 To: infofarmer@freebsd.org References: <20071122094324.GD66812@amilo.cenkes.org> In-Reply-To: <20071122094324.GD66812@amilo.cenkes.org> X-Enigmail-Version: 0.95.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: questions@freebsd.org Subject: Re: lightly loaded php+mysql - high syscall/csw rates X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2007 14:52:15 -0000 Andrew Pantyukhin wrote: > We have a php+mysql web server. It serves 15-20 http requests per > second, resulting in 100-200 sql qps. But according to vmstat(1), > it all peaks at over 500k syscall/s and 100k cswitch/s. The peaks > are quite frequent, even at this load. During the peaks top(1) > shows 30-40k VCSW for mysql and around 1k vcsw for two php-cgi > worker processes. IVCSW is relatively very low for all processes. > > This is a 4-core Opteron HP DL145 G2 server running 6.2/amd64 > generic+quota. I'm considering a switch to 7.0. > > During peaks user/system/idle in top(1) is 20/30/50. > > The question is - is the syscall and csw rates normal or should I > be trying to tune mysql and php more agressively? I'm not hungry > for performance (haven't hit the limit yet), but a couple of days > ago the server stopped responding until a cold reboot (which is > another story) - and now I'm paying closer attention to its > vitals. This sounds like it could be related to the issues being discussed on a thread on freebsd-stable titled "2 x quad-core system is slower that 2 x dual core on FreeBSD" [http://docs.freebsd.org/cgi/mailindex.cgi?sort=subject&file=current/freebsd-stable] Switching to 7 and SCHED_ULE may gain you perfromance for this kind of workload over 4 cores going by the benchmarks provided by Kris Kennaway, although they mainly deal with 8 core systems. Forcing MySQL to use libthr instead of libpthread in libmap.conf may also help also and going solely by one post in the thread mentioned above you could try reducing kern.hz in loader.conf to something like 100 as this could help reduce the context switches. Vince > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"