Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VlJ3z-0005Fj-M3 for pgsql-performance@arkaria.postgresql.org; Tue, 26 Nov 2013 13:52:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VlJ3z-0000Rk-2b for pgsql-performance@arkaria.postgresql.org; Tue, 26 Nov 2013 13:52:27 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VlJ3x-0000Rd-RH for pgsql-performance@postgresql.org; Tue, 26 Nov 2013 13:52:25 +0000 Received: from [87.118.86.135] (helo=mail.cybertec.at) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VlJ3u-0002Q5-KH for pgsql-performance@postgresql.org; Tue, 26 Nov 2013 13:52:25 +0000 Received: from localhost.localdomain (unknown [87.242.12.103]) by mail.cybertec.at (Postfix) with ESMTPSA id 4A69F3900412; Tue, 26 Nov 2013 13:51:59 +0000 (UTC) Message-ID: <5294A77F.8050508@cybertec.at> Date: Tue, 26 Nov 2013 14:51:59 +0100 From: Boszormenyi Zoltan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Heikki Linnakangas , Lee Nguyen CC: pgsql-performance@postgresql.org Subject: Re: Postgresql in a Virtual Machine References: <5293B0B9.1060200@vmware.com> In-Reply-To: <5293B0B9.1060200@vmware.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 87.118.86.135 (deferred) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org 2013-11-25 21:19 keltezéssel, Heikki Linnakangas írta: > On 25.11.2013 22:01, Lee Nguyen wrote: >> Hi, >> >> Having attended a few PGCons, I've always heard the remark from a few >> presenters and attendees that Postgres shouldn't be run inside a VM. That >> bare metal is the only way to go. >> >> Here at work we were entertaining the idea of running our Postgres database >> on our VM farm alongside our application vm's. We are planning to run a >> few Postgres synchronous replication nodes. >> >> Why shouldn't we run Postgres in a VM? What are the downsides? Does anyone >> have any metrics or benchmarks with the latest Postgres? > > I've also heard people say that they've seen PostgreSQL to perform worse in a VM. In the > performance testing that we've done in VMware, though, we haven't seen any big impact. > So I guess the answer is that it depends on the specific configuration of CPU, memory, > disks and the software. We at Cybertec tested some configurations about 2 months ago. The performance drop is coming from the disk given to the VM guest. When there is a dedicated disk (pass through) given to the VM guest, PostgreSQL runs at a speed of around 98% of the bare metal. When the virtual disk is a disk file on the host machine, we've measured 20% or lower. The host used Fedora 19/x86_64 with IIRC a 3.10.x Linux kernel with EXT4 filesystem (this latter is sure, not IIRC). The effect was observed both under Qemu/KVM and Xen. The virtual disk was not pre-allocated, since it was the default setting, i.e. space savings preferred over speed. The figure might be better with a pre-allocated disk but the filesystem journalling done twice (both in the host and the guest) will have an effect. The PostgreSQL server versions 9.2.x, 9.3beta were tested with pgbench, standalone, without replication. Best regards, Zoltán Böszörményi > Synchronous replication is likely going to be the biggest bottleneck by far, unless it's > mostly read-only. I don't know if virtualization will have a measurable impact on > network latency, which is what matters for synchronous replication. > > So, I'd suggest that you try it yourself, and see how it performs. And please report > back to the list, I'd also love to see some numbers! > > - Heikki > > -- ---------------------------------- Zoltán Böszörményi Cybertec Schönig & Schönig GmbH Gröhrmühlgasse 26 A-2700 Wiener Neustadt, Austria Web: http://www.postgresql-support.de http://www.postgresql.at/ -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance