From owner-freebsd-stable@FreeBSD.ORG Thu Jan 3 11:38:30 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 EEA6816A417; Thu, 3 Jan 2008 11:38:30 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from mx.bulinfo.net (mx.bulinfo.net [193.194.156.1]) by mx1.freebsd.org (Postfix) with ESMTP id 4158A13C4D1; Thu, 3 Jan 2008 11:38:30 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from localhost (localhost [127.0.0.1]) by mx.bulinfo.net (Postfix) with ESMTP id 38EB2160D3; Thu, 3 Jan 2008 13:38:29 +0200 (EET) Received: from mx.bulinfo.net ([127.0.0.1]) by localhost (mx.bulinfo.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 85006-04; Thu, 3 Jan 2008 13:38:27 +0200 (EET) Received: from [192.168.2.188] (pythia.bulinfo.net [212.72.195.5]) by mx.bulinfo.net (Postfix) with ESMTP id 39EED160D0; Thu, 3 Jan 2008 13:38:27 +0200 (EET) Message-ID: <477CC930.3000802@bulinfo.net> Date: Thu, 03 Jan 2008 13:38:24 +0200 From: Krassimir Slavchev User-Agent: Thunderbird 2.0.0.9 (X11/20071122) MIME-Version: 1.0 To: Kris Kennaway References: <476A5EE1.9000003@bulinfo.net> <476FF662.6050604@FreeBSD.org> <477BB7C0.3060603@bulinfo.net> <477C1FA3.2070904@FreeBSD.org> <477C2A51.1050401@FreeBSD.org> In-Reply-To: <477C2A51.1050401@FreeBSD.org> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at mx.bulinfo.net Cc: FreeBSD Subject: Re: Performance! 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: Thu, 03 Jan 2008 11:38:31 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kris Kennaway wrote: > Kris Kennaway wrote: >> Krassimir Slavchev wrote: >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA1 >>> >>> Kris Kennaway wrote: >>>> Krassimir Slavchev wrote: >>>> Hello, >>>> >>>> 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. >>>> >>>> dmesg: >>>> ... >>>> CPU: Intel(R) Xeon(R) CPU X5450 @ 3.00GHz (3000.02-MHz >>>> K8-class CPU) >>>> Origin = "GenuineIntel" Id = 0x10676 Stepping = 6 >>>> >>>> Features=0xbfebfbff >>>> >>>> >>>> >>>> Features2=0xce3bd> >>>> >>>> >>>> AMD Features=0x20000800 >>>> AMD Features2=0x1 >>>> Cores per package: 4 >>>> usable memory = 8575655936 (8178 MB) >>>> avail memory = 8288337920 (7904 MB) >>>> ACPI APIC Table: >>>> FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs >>>> ... >>>> >>>> test: >>>> sysbench --num-threads=${i} --test=oltp --pgsql-user=bench >>>> --pgsql-db=bench --db-driver=pgsql --max-time=60 --max-requests=0 >>>> --oltp-read-only=on run >>>> >>>> tuning: >>>> kern.ipc.shmmax=2147483647 >>>> kern.ipc.shmall=524288 >>>> kern.ipc.semmsl=512 >>>> kern.ipc.semmap=256 >>>> kern.ipc.somaxconn=2048 >>>> kern.maxfiles=65536 >>>> vfs.read_max=32 >>>> >>>> kern.ipc.semmni=256 >>>> kern.ipc.semmns=2048 >>>> >>>> results: >>>> FreeBSD 7.0-BETA4 amd64 (cvsup on 20.12) GENERIC with SCHED_ULE >>>> #threads #transactions/sec user/system >>>> 1 500 7.4%,5.3% >>>> 5 1990 30.9%,23.4% >>>> 10 2510 39.9%,35.0% >>>> 20 2549 44.5%,43.5% >>>> 40 1921 29.8%,59.4% >>>> 60 1580 22.7%,70.6% >>>> 80 1341 18.9%,75.9% >>>> 100 1227 16.5%,79.3% >>>> >>>> Linux >>>> #threads #transactions/sec >>>> 1 693 >>>> 5 3539 >>>> 10 5789 >>>> 20 5791 >>>> 40 5661 >>>> 60 5517 >>>> 80 5401 >>>> 100 5319 >>>> >>>> >>>> What can be done to improve these results? >>>> >>>> Best Regards >>>> >>> _______________________________________________ >>> freebsd-stable@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-stable >>> To unsubscribe, send any mail to >>> "freebsd-stable-unsubscribe@freebsd.org" >>> . >>> >>>> postgresql has some poor default settings on FreeBSD. You need to add: >>> >>>> stats_command_string = off >>>> update_process_title = off >>> >>>> Kris >>> >>> I use a copy of postgresql.conf file from linux. >>> Only 'stats_command_string = on' was commented. >>> Here are results with these settings and lock_manager patch: >>> >>> #threads #transactions/sec >>> 1 582 >>> 5 2154 >>> 10 2253 >>> 20 2705 >>> 40 2215 >>> 60 1713 >>> 80 1574 >>> 100 1256 >> >> Please enable LOCK_PROFILING in your kernel and then do >> >> sysctl debug.lock.prof.enable=1 >> >> sysctl debug.lock.prof.enable=0 >> >> and send me the output of >> >> sysctl debug.lock.prof.stats >> >> Kris >> > I have sent the results to you. If someone else interested in these results I will put them somewhere. > Are you using postgresql 8.1 or older? It didn't have the > update_process_title option to disable the setproctitle() calls that > have a large performance penalty on FreeBSD. Try with 8.2 or hack the > source to disable it. It is 8.2 from ports. pkg_info: postgresql-server-8.2.5_2 The most advanced open-source database available anywhere > > Kris > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHfMkvxJBWvpalMpkRAhe+AJ9Bsl0ciZ6kPHtJT9RVjDo4E4fNxgCcC7qH 5veO734c+yDgEY945dwINAg= =cdYT -----END PGP SIGNATURE-----