From owner-freebsd-stable@FreeBSD.ORG Fri Jan 11 17:35:12 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4F2316A41B for ; Fri, 11 Jan 2008 17:35:12 +0000 (UTC) (envelope-from kometen@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.245]) by mx1.freebsd.org (Postfix) with ESMTP id 8837613C45A for ; Fri, 11 Jan 2008 17:35:12 +0000 (UTC) (envelope-from kometen@gmail.com) Received: by an-out-0708.google.com with SMTP id c14so320898anc.13 for ; Fri, 11 Jan 2008 09:35:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=tu1w2uSlKSRlk1oSX3I6OQ1L9tefmqpzWrPUG4xxfNE=; b=DGiCohH8zW9ju8kcC/qbvpnzCHlOoiPoNwo9grXSF0zzcXd6cdjeZRM82zqUAx5Ek/F2AcdJGym5pALHam6TTYtbmMpmso8Wx49/NR/BhW7SV5/E3PSy/dNQbckdWdNuMQtJZugefGJIMLcH4GCpYBkhWYMIrGYck6b3qAhiwmo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=onJTzJ7Qy/ygSUgqUIOjkMg6ZXsLLCll+TmoovmhFvQnOdlIhZzqZaiy1JpUkbHAYl4PC1Qe1MOkuRsloFCClBhzbt8GfNvF0JoaKodmpaAyosr/D814I7QzyFbslPK/nr7+WJyOEZYBv/VndbgoEGHPrdQ6i+OpVsgLjvDjOmI= Received: by 10.100.249.9 with SMTP id w9mr7282158anh.67.1200072911600; Fri, 11 Jan 2008 09:35:11 -0800 (PST) Received: by 10.100.228.15 with HTTP; Fri, 11 Jan 2008 09:35:11 -0800 (PST) Message-ID: Date: Fri, 11 Jan 2008 18:35:11 +0100 From: "Claus Guttesen" To: "Kris Kennaway" In-Reply-To: <4787A41C.70100@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <476A5EE1.9000003@bulinfo.net> <476FF662.6050604@FreeBSD.org> <477BB7C0.3060603@bulinfo.net> <4787A41C.70100@FreeBSD.org> Cc: FreeBSD Subject: Re: Performance! [SOLVED] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2008 17:35:12 -0000 > >> I have read all related threads about performance problems with multi > >> core systems but still have no idea what to do to make thinks better. > >> Below are results of testing postgresql on HP DL380G5 using sysbench. > >> The results are comparable to: > >> http://blog.insidesystems.net/articles/2007/04/11/postgresql-scaling-on-6-2-and-7-0 > >> > >> but the same tests running on the same hardware using Linux (kernel > >> 2.6.18-53.1.4.el5 SMP x86_64) are very different. > >> PostgreSQL is tuned equal. > > Just to summarize some discussion we had off-list, this problem is now > resolved. It turned out to have two causes: > > 1) sysbench on linux was defaulting to using a unix domain socket to > communicate with pgsql, but FreeBSD was using TCP to 127.0.0.1. TCP has > much more overhead so performance was lower. Using --pgsql-host="" in > sysbench is the fix for this. > > 2) pgsql was not compiled with thread support enabled, which caused lots > of bad interactions with the threaded sysbench client. This probably > would have caused data corruption too (silent in this case because > nothing was checking the query responses). The fix was to recompile the > pgsql client and server with the THREADSAFE option enabled. > > Krassimir reports that with these two fixes, the standard 7.0 kernel has > performance: > > #threads transactions/sec > 1 755 > 8 7129 > 40 6580 > 100 6768 > > compared to Linux: > > Linux (2.6.18) > #threads #transactions/sec > 1 693 > 5 3539 > 10 5789 > 20 5791 > 40 5661 > 60 5517 > 80 5401 > 100 5319 > > Linux (2.6.23) > #threads #transactions/sec > 1 740 > 5 2675 > 10 6486 > 20 6893 > 40 6623 > 60 6623 > 80 6522 > 100 6417 > > I think this is a satisfactory resolution :) Thank you so much! (both of you and those who helped along the way) :-) On monday I will start testing a setup where we are moving from four 10K rpm sas disk in raid 1+0 to eight 15K rpm sas disks in raid 1+0 as well. The former is a ciss p400 controller with 512 MB bbc and the latter is a p800 with 512 MB bbc and an external msa-box. I will test with 7.0 and postgresql 8.2 from ports. Should I test with stable or release? Are there any patches I can apply? Our current db-server is a DL380 G5 woodcrest at 3 Ghz and my test-server will be a 8-core DL360 G5 at 2.4 Ghz (I think). I will log the queries from our live-server and repeat them on the test-server, use pgbench on FreeBSD, Solaris and Linux. I was getting a bit worried when the number varied so much between Linux and FreeBSD. -- regards Claus When lenity and cruelty play for a kingdom, the gentlest gamester is the soonest winner. Shakespeare