Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id BF596B5DBCC for ; Tue, 9 Aug 2011 00:52:51 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 79387-09 for ; Tue, 9 Aug 2011 03:52:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mail.postgresql.org (Postfix) with ESMTP id 70E6DB5D8C5 for ; Tue, 9 Aug 2011 00:52:44 -0300 (ADT) Received: from [192.168.1.3] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LyB8P-1RMiUe1KNR-0162la; Tue, 09 Aug 2011 05:52:41 +0200 Message-ID: <4E40AF07.9050004@2ndquadrant.com> Date: Mon, 08 Aug 2011 23:52:39 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Dusan Misic CC: pgsql-performance@postgresql.org Subject: Re: Postgres performance on Linux and Windows References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:GaFUnCri9E27H9BXKtYAI/a9KEPNUi7qi/8hX9r1VHT +Y6apZ2oH0cDnNBiagYjTeXYs1UQeY2oeSf1vcyDZXX76IXXJj tF5ht4jRPXfDjcIqhdGftyAzRIDrtMxKjbofmRolELg84Jtlen 5pie9mffzw10Upr9dGGmrmL4/dMq/XmZcPQTShF+biW9nrGzvY RZGZK1pdQVYpdvcr/uME1MdDEhptkL9mIfJ46bNC1s= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201108/108 X-Sequence-Number: 44555 Dusan Misic wrote: > > I had done some testing for my application (WIP) and I had executed > same SQL script and queries on real physical 64-bit Windows 7 and on > virtualized 64-bit CentOS 6. > > Both database servers are tuned with real having 8 GB RAM and 4 cores, > virtualized having 2 GB RAM and 2 virtual cores. > > Virtualized server crushed real physical server in performance in both > DDL and DML scripts. > > My question is simple. Does PostgreSQL perform better on Linux than on > Windows and how much is it faster in your tests? > You didn't mention what tuning you did on the Windows server. If you set shared_buffers to a large value, more than around 512MB, that's been reported to slow the server down rather than make it faster on that OS. The other thing you can easily get wrong in this sort of comparison is having one server enforce synchronous writes, while the other cheats. Many virtualized systems will not flush information to disk properly during writes, which is faster but can lead to database corruption after a crash. See http://wiki.postgresql.org/wiki/Reliable_Writes for more information on this general topic. Generally for a VM solution, you need to check if it properly handles the "fsync" system call. Comparing performance across two different operating systems fairly is really hard to get right. It's easy to skew the results because of something unrelated to the difference in database performance, such as Kevin's commentary about network speed heavily influencing results. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us