Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b0B4D-0005we-DE for pgsql-admin@arkaria.postgresql.org; Tue, 10 May 2016 17:03:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b0B4C-0007wb-W7 for pgsql-admin@arkaria.postgresql.org; Tue, 10 May 2016 17:03:29 +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 1b0B2U-0004rf-4Q for pgsql-admin@postgresql.org; Tue, 10 May 2016 17:01:42 +0000 Received: from mail-oi0-x229.google.com ([2607:f8b0:4003:c06::229]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1b0B2R-0005hL-Fr for pgsql-admin@postgresql.org; Tue, 10 May 2016 17:01:40 +0000 Received: by mail-oi0-x229.google.com with SMTP id v145so25875971oie.0 for ; Tue, 10 May 2016 10:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=u4LAuYEswLYGFseSK/kIE7fHD+1aLBlw7AQNgVa5j5U=; b=ImL6qoxUCEE0myUpvBBwfZSrHQZlKnwISDM+MGSIqI+3QF+o8mo1uaERdbdX8bYtsg yeOAz1vEqfM/Y7oT5rPijp/KJPuUMbS8oFJcDbBorMan8DsNLrNA6k4d6xg+/bif3gas yFlgRpX9hzC7CuxGfk8FFcn/vx34Oe/+Bo90n21kGIbHvb6UOoITFYVJ0lH4w53eNsDg QoHwHmKv63Y7xhxn7McHxNn3sZrqdIElRf0EiYQStjVqRRqvwT2IkFpBDxpGOz35I0Xc VvLfCGmheOms4yGJ5v8azlAACERm/IBsQaRJrKAiF0LHmnbapbmttAMeIvC0C+ZeVbz2 5ttw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=u4LAuYEswLYGFseSK/kIE7fHD+1aLBlw7AQNgVa5j5U=; b=DTDWy8Syqi7VxqywkEdYvVqIdvgwk9Pkk/B0rKKq+4EVaXUhHcjPSM74KRZQPQq/V4 j8WzX+AtGw8Fex+zEm4OegjuqcWowo7FrSUfU1e4bmKbaseFzAm9JL7j7KaEF1nYHdfR QBtiD5nBJXPQ2SYf0WGHiTDWkIyUk5ieMqWSOHV2GvQqyECzeH/o4C3LtP26MviNVEq1 0KNkBf1HhesswKM5RhIoatCyfd068tXoNjbdaG48J6rGGcJxw1+GJZ6PORFzzn5uWlK0 HIu9u61eVEISS2bq1b+i4G3jjo5ysU6xycMJYP2Fb7txSHnWXArvG1j3uPC7CewU3p33 Lk8A== X-Gm-Message-State: AOPr4FXyMhu94F3itHNw24NOmnxcLyNuBN9wcqvdLTpfc+N+rxp/zZXbWF4WP1kWM9xqpw== X-Received: by 10.202.207.73 with SMTP id f70mr16095347oig.95.1462899698679; Tue, 10 May 2016 10:01:38 -0700 (PDT) Received: from [192.168.0.3] (cpe-72-182-26-34.austin.res.rr.com. [72.182.26.34]) by smtp.gmail.com with ESMTPSA id s127sm811396oie.4.2016.05.10.10.01.37 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 May 2016 10:01:38 -0700 (PDT) Content-Type: multipart/alternative; boundary=Apple-Mail-E713BE55-5EAE-4F5B-8772-C632ED79C8B8 Mime-Version: 1.0 (1.0) Subject: Re: driving postgres to achieve benchmark results similar to bonnie++ From: John Scalia X-Mailer: iPad Mail (13E238) In-Reply-To: Date: Tue, 10 May 2016 12:01:37 -0500 Cc: "pgsql-admin@postgresql.org" Content-Transfer-Encoding: 7bit Message-Id: References: To: Mike Broers X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org --Apple-Mail-E713BE55-5EAE-4F5B-8772-C632ED79C8B8 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Sent from my iPad > On May 10, 2016, at 10:48 AM, Mike Broers wrote: >=20 > I'm having trouble getting postgres to drive enough disk activity to get e= ven close to the disk benchmarking I'm getting with bonnie++. We have SSD S= AN and the xlog is on its own ssd volume as well, postgres 9.5 running on ce= ntos 6. >=20 > bonnie++ -n 0 -f -b is the command im running, pointing to either primary d= ata or xlog location Im consistently seeing numbers like this: >=20 > Version 1.03e ------Sequential Output------ --Sequential Input- --Ra= ndom- > -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Se= eks-- >=20 > Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP >=20 > 23808M 786274 92 157465 29 316097 17 5751 16 >=20 > So during bonnie++ tests I've confirmed in our monitoring write peaks at 7= 00/800 MB/sec and read peaks around 280/300 MB/sec.=20 >=20 > We have 12GB RAM on the server, when I run pgbench with a scale that sets t= he pgbench database in the realm of 18GB - 25GB I barely break 110MB/sec wri= tes and 80MB/sec. I'm running with different options such unlogged tables a= nd logged tables, prepared transactions or not, and transaction counts betwe= en 1000 and 40000. >=20 > I thought a parallel pg_dump / restore might also drive disk but that perf= ormance doesnt drive disk throughput either, topping out around 75MB/sec rea= d. Nightly vacuums also seem to peak below 110MB/sec reads as well. =20 >=20 > Here are the nondefault pg settings:=20 >=20 > max_connections =3D 1024 > shared_buffers =3D 1024MB > wal_buffers =3D 16MB > checkpoint_completion_target =3D '.9' > archive_mode =3D on > random_page_cost =3D '1.5' > maintenance_work_mem =3D 512MB > work_mem =3D 64MB > max_wal_senders =3D 5 > checkpoint_timeout =3D 10min > effective_io_concurrency =3D 4 > effective_cache_size =3D 8GB > wal_keep_segments =3D 512 > wal_level =3D hot_standby > synchronous_commit =3D off >=20 > Any idea of if/why postgres might be bottlenecking disk throughput? Or if= there is a method for testing to achieve something closer the bonnie++ leve= ls from within postgres that I am missing? I'm guessing I'm just not drivin= g enough activity to push it to the limit but I'm not sure of a straightforw= ard method to verify this.=20 >=20 > Thanks, >=20 > Mike >=20 Well, I'm no expert with Bonnie, but several of your PostgreSQL settings loo= k incorrect according to the system config you provided. With 12Gb of RAM, s= hared_buffers should probably be closer to at least 3092Mb. That is if you f= ollow the general suggestion for having that at 1/4 of your available RAM. A= lso, your max_connections settings looks awfully high. Do you really need 10= 24 connections? Suggest, if so, that you look into a connection pooling soft= ware, like pgpool-II or something. With an SSD drive, I also doubt your random page cost is that high. With tha= t setting, you may be forcing a lot of queries to use sequential access, not= random. Finally, increase the two work mem settings. I can't recommend any settings w= ithout knowing what kind of queries you're running. -- Jay= --Apple-Mail-E713BE55-5EAE-4F5B-8772-C632ED79C8B8 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


Sent from my iPad
On May 10, 2016, at 10:48 AM, Mike Broers <mbroers@gmail.com> wrote:

I'm having trouble getting postgres to drive enou= gh disk activity to get even close to the disk benchmarking I'm getting with= bonnie++.   We have SSD SAN and the xlog is on its own ssd volume as w= ell, postgres 9.5 running on centos 6.

bonnie++ -n 0 -f -b is the command im running, pointing to either prima= ry data or xlog location Im consistently seeing numbers like this:

V= ersion 1.03e       ------Sequential Output------ --Sequential= Input- --Random-

            &nb= sp;       -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- -= -Seeks--

      Size K/sec %CP K/se= c %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP

23808M           786= 274  92 157465  29           316097 = 17  5751  16

So during bonnie++ tests I'v= e confirmed in our monitoring write peaks at 700/800 MB/sec and read peaks a= round 280/300 MB/sec. 

We have 12GB RAM on the server,= when I run pgbench with a scale that sets the pgbench database in the realm= of 18GB - 25GB I barely break 110MB/sec writes and 80MB/sec.   I'm run= ning with different options such unlogged tables and logged tables, prepared= transactions or not, and transaction counts between 1000 and 40000.

I thought a parallel pg_dump / restore might also drive disk but t= hat performance doesnt drive disk throughput either, topping out around 75MB= /sec read.  Nightly vacuums also seem to peak below 110MB/sec reads as w= ell.  

Here are the nondefault pg settings: 

<= p class=3D"">max_connections =3D 1024
shared_buff= ers =3D 1024MB
wal_buffers =3D 16MB
checkpoint_completion_target =3D '= .9'
archive_mode =3D on
random_page_cost =3D '1.5'
maintenance_work= _mem =3D 512MB
work_mem =3D 64MB
max_wal_senders =3D 5
checkpoint_t= imeout =3D 10min
effective_io_concurrency =3D 4
effective_cache_size =3D= 8GB
wal_keep_segments =3D 512
wal_level =3D hot_standby
synchronou= s_commit =3D off

Any idea of if/why postgres might be bottl= enecking disk throughput?  Or if there is a method for testing to achie= ve something closer the bonnie++ levels from within postgres that I am missi= ng?  I'm guessing I'm just not driving enough activity to push it to th= e limit but I'm not sure of a straightforward method to verify this. 

Thanks,

Mike

Well, I'm no expert with Bonnie, but several of your Post= greSQL settings look incorrect according to the system config you provided. W= ith 12Gb of RAM, shared_buffers should probably be closer to at least 3092Mb= . That is if you follow the general suggestion for having that at 1/4 of you= r available RAM. Also, your max_connections settings looks awfully high. Do y= ou really need 1024 connections? Suggest, if so, that you look into a connec= tion pooling software, like pgpool-II or something.

With a= n SSD drive, I also doubt your random page cost is that high. With that sett= ing, you may be forcing a lot of queries to use sequential access, not rando= m.

Finally, increase the two work mem settings. I c= an't recommend any settings without knowing what kind of queries you're runn= ing.
--
Jay
= --Apple-Mail-E713BE55-5EAE-4F5B-8772-C632ED79C8B8--