Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1elnzM-000311-Fn for pgsql-performance@arkaria.postgresql.org; Wed, 14 Feb 2018 03:44:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1elnzL-0008St-AA for pgsql-performance@arkaria.postgresql.org; Wed, 14 Feb 2018 03:44:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1elnzL-0008RE-2k for pgsql-performance@lists.postgresql.org; Wed, 14 Feb 2018 03:44:07 +0000 Received: from cat-porwal-prod-mail1.catalyst.net.nz ([202.78.240.226]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1elnzF-0007NU-6p for pgsql-performance@lists.postgresql.org; Wed, 14 Feb 2018 03:44:05 +0000 Received: from [IPv6:2406:e001:839:1:2c81:d27b:19d2:e833] (unknown [IPv6:2406:e001:839:1:2c81:d27b:19d2:e833]) (Authenticated sender: mark.kirkwood@catalyst.net.nz) by cat-porwal-prod-mail1.catalyst.net.nz (Postfix) with ESMTPSA id 1EA2C80BE8; Wed, 14 Feb 2018 16:43:51 +1300 (NZDT) Subject: Re: OT: Performance of VM To: Robert Klemme , Andrew Kerber Cc: Andreas Kretschmer , pgsql-performance@lists.postgresql.org References: <3bc54eb3-135d-692c-47e2-208189a350d7@thomas-guettler.de> <91fec1f8-d11d-2413-6b57-5310ab0e3b8a@a-kretschmer.de> From: Mark Kirkwood Message-ID: Date: Wed, 14 Feb 2018 16:43:50 +1300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Authentication-Results: auth=pass smtp.auth=mark.kirkwood@catalyst.net.nz smtp.mailfrom=mark.kirkwood@catalyst.net.nz List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/02/18 00:20, Robert Klemme wrote: > On Mon, Feb 5, 2018 at 5:22 PM, Andrew Kerber wrote: >> Have them check the memory and CPU allocation of the hypervisor, make sure >> its not overallocated. Make sure the partitions for stroage are aligned (see >> here: >> https://blogs.vmware.com/vsphere/2011/08/guest-os-partition-alignment.html) >> . Install tuned, and enable the throughput performance profile. Oracle has a >> problem with transparent hugepages, postgres may well have the same problem, >> so consider disabling transparent hugepages. There is no reason why >> performance on a VM would be worse than performance on a physical server. > Not theoretically. But in practice if you have anything run in a VM > like in this case you do not know what else is working on that box. > Analyzing these issues can be really cumbersome and tricky. This is > why I am generally skeptical of running a resource intensive > application like a RDBMS in a VM. To get halfway predictable results > you want at least a minimum of resources (CPU, memory, IO bandwidth) > reserved for that VM. > > Anecdote: we once had a customer run our application in a VM (which is > supported) and complain about slowness. Eventually we found out that > they over committed memory - not in sum for all VMs which is common, > but this single VM had been configured to have more memory than was > physically available in the machine. > Agreed. If you can get the IO layer to have some type of guaranteed performance (e.g AWS Provisioned IOPS), then that is a big help. However (as you say above) debugging memory and cpu contention (from within the guest) is tricky indeed. Anecdote: concluded VM needed more cpu, so went to 8 to 16 - performance got significantly *worse*. We prevailed on the devops guys (this was *not* AWS) to migrate the VM is a less busy host. Everything was fine thereafter. regards Mark