Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNAd5-0003DF-GC for pgsql-performance@arkaria.postgresql.org; Fri, 08 Dec 2017 04:51:19 +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 1eNAd4-0001Av-Ux for pgsql-performance@arkaria.postgresql.org; Fri, 08 Dec 2017 04:51:18 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eNAd4-0001Am-Kz for pgsql-performance@lists.postgresql.org; Fri, 08 Dec 2017 04:51:18 +0000 Received: from cat-porwal-prod-mail1.catalyst.net.nz ([2404:130:4080::4]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eNAd0-0007Ho-FD for pgsql-performance@lists.postgresql.org; Fri, 08 Dec 2017 04:51:16 +0000 Received: from [IPv6:2406:e001:a79:1:683f:2737:e91e:4034] (unknown [IPv6:2406:e001:a79:1:683f:2737:e91e:4034]) (Authenticated sender: mark.kirkwood@catalyst.net.nz) by cat-porwal-prod-mail1.catalyst.net.nz (Postfix) with ESMTPSA id 1FC5380A63; Fri, 8 Dec 2017 17:51:08 +1300 (NZDT) Subject: Re: Setting effective_io_concurrency in VM? To: Scott Marlowe , Don Seiler Cc: pgsql-performance@lists.postgresql.org References: From: Mark Kirkwood Message-ID: <3b52abb7-37d5-d18c-d677-9f5052ffd4df@catalyst.net.nz> Date: Fri, 8 Dec 2017 17:51:08 +1300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.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 28/11/17 07:40, Scott Marlowe wrote: > On Mon, Nov 27, 2017 at 11:23 AM, Don Seiler wrote: >> Good afternoon. >> >> We run Postgres (currently 9.2, upgrading to 9.6 shortly) in VMWare ESX >> machines. We currently have effective_io_concurrency set to the default of >> 1. I'm told that the data volume is a RAID 6 with 14 data drives and 2 >> parity drives. I know that RAID10 is recommended, just working with what >> I've inherited for now (storage is high-end HP 3Par and HP recommended RAID >> 6 for best performance). >> >> Anyway, I'm wondering if, in a virtualized environment with a VM datastore, >> it makes sense to set effective_io_concurrency closer to the number of data >> drives? >> >> I'd also be interested in hearing how others have configured their >> PostgreSQL instances for VMs (if there's anything special to think about). > Generally VMs are never going to be as fast as running on bare metal > etc. You can adjust it and test it with something simple like pgbench > with various settings for -c (concurrency) and see where it peaks etc > with the setting. This will at least get you into the ball park. > > A while back we needed fast machines with LOTS of storage (7TB data > drives with 5TB of data on them) and the only way to stuff that many > 800GB SSDs into a single machine was to use RAID-5 with a spare (I > lobbied for RAID6 but was overidden eh...) We were able to achieve > over 15k TPS in pgbench with a 400GB data store on those boxes. The > secret was to turn off the cache in the RAID controller and cranl up > effective io concurrency to something around 10 (not sure, it's been a > while). > > tl;dr: Only way to know is to benchmark it. I'd guess that somewhere > between 10 and 20 is going to get the best throughput but that's just > a guess. Benchmark it and let us know! Reasonably modern Linux hosts with Linux guests using Libvirt/KVM should be able to get bare metal performance for moderate numbers of cpus (<=8 last time we benchmarked). It certainly *used* to be the case that virtualization sucked for databases, but not so much now. The advice to benhmark, however - is golden :-) Cheers Mark