Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 7904F9FBE0E for ; Wed, 21 Feb 2007 17:12:51 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 81596-05 for ; Wed, 21 Feb 2007 17:12:43 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from smtp5.clear.net.nz (smtp5.clear.net.nz [203.97.33.68]) by postgresql.org (Postfix) with ESMTP id A0E709FBCE6 for ; Wed, 21 Feb 2007 17:12:45 -0400 (AST) Received: from [192.168.1.11] (121-72-73-196.dsl.telstraclear.net [121.72.73.196]) by smtp5.clear.net.nz (CLEAR Net Mail) with ESMTP id <0JDU00J4Z096ZF30@smtp5.clear.net.nz> for pgsql-performance@postgresql.org; Thu, 22 Feb 2007 10:12:43 +1300 (NZDT) Date: Thu, 22 Feb 2007 10:12:42 +1300 From: Mark Kirkwood Subject: Re: Postgres performance Linux vs FreeBSD In-reply-to: <45DC1786.80504@polok.pl> To: =?ISO-8859-1?Q?Jacek_Zar=EAba?= Cc: pgsql-performance@postgresql.org Message-id: <45DCB5CA.8090807@paradise.net.nz> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 8BIT References: <45DC1786.80504@polok.pl> User-Agent: Thunderbird 1.5.0.9 (X11/20061227) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.057 tagged_above=0 required=5 tests=AWL, BAYES_50 X-Spam-Level: X-Archive-Number: 200702/224 X-Sequence-Number: 23278 Jacek Zaręba wrote: > Hello, I've set up 2 identical machines, hp server 1ghz p3, > 768mb ram, 18gb scsi3 drive. On the first one I've installed > Debian/GNU 4.0 Linux, on the second FreeBSD 6.2. On both > machines I've installed Postgresql 8.2.3 from sources. > Now the point :)) According to my tests postgres on Linux > box run much faster then on FreeBSD, here are my results: > With respect to 'select count(*) from ...' being slower on FreeBSD, there are a number of things to try to make FreeBSD faster for this sort of query. Two I'm currently using are: - setting sysctl vfs.read_max to 16 or 32 - rebuilding the relevant filesystem with 32K blocks and 4K frags I have two (almost) identical systems - one running Gentoo, one running FreeBSD 6.2. With the indicated changes the FreeBSD system performs pretty much the same as the Gentoo one. With respect to the 'explain analyze' times, FreeBSD has a more accurate and more expensive gettimeofday call - which hammers its 'explain analyze' times compared to Linux. Cheers Mark