Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VlKk6-0000gm-OW for pgsql-performance@arkaria.postgresql.org; Tue, 26 Nov 2013 15:40:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VlKk6-0007fh-8Y for pgsql-performance@arkaria.postgresql.org; Tue, 26 Nov 2013 15:40:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VlKk5-0007fb-FH for pgsql-performance@postgresql.org; Tue, 26 Nov 2013 15:40:01 +0000 Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VlKjz-0001lz-9F for pgsql-performance@postgresql.org; Tue, 26 Nov 2013 15:40:01 +0000 Received: from mfilter28-d.gandi.net (mfilter28-d.gandi.net [217.70.178.159]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id 0E5A141C0B1; Tue, 26 Nov 2013 16:39:53 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter28-d.gandi.net Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by mfilter28-d.gandi.net (mfilter28-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id HE-H8Qca7ncJ; Tue, 26 Nov 2013 16:39:51 +0100 (CET) X-Originating-IP: 98.27.58.255 Received: from [192.168.10.146] (cpe-098-027-058-255.nc.res.rr.com [98.27.58.255]) (Authenticated sender: adsend@dunslane.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id E521641C06F; Tue, 26 Nov 2013 16:39:49 +0100 (CET) Message-ID: <5294C0C4.1080003@dunslane.net> Date: Tue, 26 Nov 2013 10:39:48 -0500 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Boszormenyi Zoltan CC: Heikki Linnakangas , Lee Nguyen , pgsql-performance@postgresql.org Subject: Re: Postgresql in a Virtual Machine References: <5293B0B9.1060200@vmware.com> <5294A77F.8050508@cybertec.at> In-Reply-To: <5294A77F.8050508@cybertec.at> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) 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 On 11/26/2013 08:51 AM, Boszormenyi Zoltan wrote: > 2013-11-25 21:19 keltez=E9ssel, Heikki Linnakangas =EDrta: >> 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.=20 >>> That >>> bare metal is the only way to go. >>> >>> Here at work we were entertaining the idea of running our Postgres=20 >>> database >>> on our VM farm alongside our application vm's. We are planning to=20 >>> run a >>> few Postgres synchronous replication nodes. >>> >>> Why shouldn't we run Postgres in a VM? What are the downsides? Does=20 >>> anyone >>> have any metrics or benchmarks with the latest Postgres? >> >> I've also heard people say that they've seen PostgreSQL to perform=20 >> worse in a VM. In the performance testing that we've done in VMware,=20 >> though, we haven't seen any big impact. So I guess the answer is that=20 >> it depends on the specific configuration of CPU, memory, disks and=20 >> 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=20 > kernel > with EXT4 filesystem (this latter is sure, not IIRC). The effect was=20 > 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=20 > in the > host and the guest) will have an effect. Not-pre-allocated disk-file backed is just about the worst case in my=20 experience. Try pre-allocated VirtIO disks on an LVM volume group - you should get=20 much better performance. cheers andrew --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance