Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gViac-0004GF-Rf for pgsql-performance@arkaria.postgresql.org; Sat, 08 Dec 2018 19:48:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gViaa-0001vI-7Q for pgsql-performance@arkaria.postgresql.org; Sat, 08 Dec 2018 19:48:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gViaZ-0001re-Sy for pgsql-performance@lists.postgresql.org; Sat, 08 Dec 2018 19:48:36 +0000 Received: from sonic306-3.consmr.mail.bf2.yahoo.com ([74.6.132.42]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gViaW-00061U-U2 for pgsql-performance@lists.postgresql.org; Sat, 08 Dec 2018 19:48:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1544298511; bh=Id9CyhSXHtYChcS0JmcyL1oQCiupKdOR9+FNZDMN8Do=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject; b=FG3DofnH37EY65y3mXNU19peTNRop9R2jkx8HRJ0e5EsGSak9HMayy/jjCKr3g7VgPbZ3H5olmiTy2kmMUbeHA1nKH2DOmRKbMX4gxXo0Z1sdv1eAnsK1onvK1gRmh4s/bgk3qJMKCdOkUZtzf19TI8ChbL8u09b6pO12rP7YJ024tU1pnh3ieKoXa9ZXaKihy7rlmDyO0CX/xxv4m12FS0AvmXRekm9k0B4j1GRvcF/5M1gsxiAS1heB2b0uxKYNQoft3RYM69yp6GSSrlnPYhzLIa1xPwIJM0l7YORKcLUwamEYJ6yP8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arvNvIrft6VDqP126 4BMGxq6CrGxwNkyLOci7vhuqW4RLyyIQs Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Sat, 8 Dec 2018 19:48:31 +0000 Received: from pool-100-19-93-133.phlapa.fios.verizon.net (EHLO [192.168.1.152]) ([100.19.93.133]) by smtp403.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 80e57f3bb218d245331611bbe1883e94; Sat, 08 Dec 2018 19:48:29 +0000 (UTC) Content-Type: multipart/alternative; boundary=Apple-Mail-5CA664DD-7DBA-47DD-8E24-10EB10927178 Mime-Version: 1.0 (1.0) Subject: Re: amazon aroura config - seriously overcommited defaults? (May be Off Topic) From: Bob Lunney X-Mailer: iPhone Mail (16B92) In-Reply-To: Date: Sat, 8 Dec 2018 14:48:24 -0500 Cc: pgsql-performance@lists.postgresql.org Content-Transfer-Encoding: 7bit Message-Id: <05ECB2C1-38CF-4E4E-8B4F-DA52A0A79D83@yahoo.com> References: To: Square Bob List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail-5CA664DD-7DBA-47DD-8E24-10EB10927178 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Aurora doesn=E2=80=99t use a typical file system so the RAM usually reserved= for the OS file system bufffer cache is instead used for shared_buffers.=20= We run multiple Aurora/ PG instances and they work quite well. There are li= mitations in superuser private, so be aware of that, but generally speaking A= urora/PG works well.=20 Bob Lunney Sent from my PDP11 > On Dec 8, 2018, at 2:03 PM, Square Bob wrote: >=20 > This question is probably more of a fit for the performance list, sorry fo= r the cross post >=20 >=20 >=20 > -------- Forwarded Message -------- > Subject: amazon aroura config - seriously overcommited defaults? (Ma= y be Off Topic) > Date: Sat, 8 Dec 2018 12:00:33 -0700 > From: Square Bob > To: pgsql-general@lists.postgresql.org >=20 >=20 > All; >=20 >=20 > My apologies if this is off topic. >=20 >=20 > Our company is moving to Aurora, In the past I would take care not to allo= w postgresql to over-commit memory beyond the actual memory on the server, w= hich meant I would add the buffer pool + (work_mem * max_connections) + (mai= ntenance_work_mem * autovacuum threads) >=20 >=20 > However as I look at the aroura defaults they are all off the charts, for e= xample, based on the calculations in the config (amazon doesn't make it easy= , some settings are in pages, some are in kb, some are who knows what) I see= the following settings as default in our aroura config: >=20 >=20 > The instance size is db.r4.xlarge >=20 >=20 > this instance size is listed as having 30.5GB of ram >=20 >=20 > Here's the default settings: >=20 >=20 > shared_buffers: {DBInstanceClassMemory/10922} >=20 > which equates to 24GB >=20 >=20 > work_mem: 64000 (kb) >=20 > which equates to 65.5MB >=20 >=20 > maintenance_work_mem: GREATEST({DBInstanceClassMemory/63963136*1024},65536= ) >=20 > which equates to 4.2GB >=20 >=20 > max_connections: LEAST({DBInstanceClassMemory/9531392},5000) >=20 > which equates to 3,380 >=20 >=20 > According to my math (If I got it right) in a worst case scenario, >=20 > if we maxed out max_connections, work_mem and maintenance_work_mem limits >=20 > the db would request 247GB of memory >=20 >=20 > Additionally amazon has set effective_cache_size =3D > {DBInstanceClassMemory/10922} >=20 > which equates to about 2.9MB (which given the other outlandish setting may= be the only appropriate setting in the system) >=20 >=20 >=20 > What the hell is amazon doing here? Am I missing the boat on tuning postgr= esql memory? Is amazon simply counting on the bet that users will never full= y utilize an instance? >=20 >=20 > Thanks in advance >=20 >=20 >=20 --Apple-Mail-5CA664DD-7DBA-47DD-8E24-10EB10927178 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Aurora doesn=E2=80=99t use a typical file s= ystem so the RAM usually reserved for the OS file system bufffer cache is in= stead used for shared_buffers. 

We run multiple Auro= ra/ PG instances and they work quite well.  There are limitations in su= peruser private, so be aware of that, but generally speaking Aurora/PG works= well. 

Bob Lunney

Sent from my PDP11

O= n Dec 8, 2018, at 2:03 PM, Square Bob <square_bob@yahoo.com> wrote:

=20 =20 =20

This question is probably more of a fit for the performance list, sorry for the cross post



-------- Forwarded Message --------
Subjec= t: amazon aroura config - seriously overcommited defaults? (May be Off Topic)
Date: <= /th> Sat, 8 Dec 2018 12:00:33 -0700
From: <= /th> Square Bob <square_bob@yahoo.com>
To: pgsql-general@lists.postgresql.org


All;


My apologies if this is off topic.


Our company is moving to Aurora, In the past I would take care not to allow postgresql to over-commit memory beyond the actual memory on the server, which meant I would add the buffer pool + (work_mem * max_connections) + (maintenance_work_mem * autovacuum threads)


However as I look at the aroura defaults they are all off the charts, for example, based on the calculations in the config (amazon doesn't make it easy, some settings are in pages, some are in kb, some are who knows what) I see the following settings as default in our aroura config:


The instance size is db.r4.xlarge


this instance size is listed as having 30.5GB of ram


Here's the default settings:


shared_buffers: {DBInstanceClassMemory/10922}

which equates to 24GB


work_mem:   64000 (kb)

which equates to 65.5MB


maintenance_work_mem: GREATEST({DBInstanceClassMemory/63963136*1024},65536)

which equates to 4.2GB


max_connections: LEAST({DBInstanceClassMemory/9531392},5000)

which equates to 3,380


According to my math (If I got it right)  in a worst case scenario,

if we maxed out max_connections, work_mem and maintenance_work_mem limits

the db would request 247GB of memory


Additionally amazon has set effective_cache_size =3D
{DBInstanceClassMemory/10922}

which equates to about 2.9MB (which given the other outlandish setting may be the only appropriate setting in the system)



What the hell is amazon doing here? Am I missing the boat on tuning postgresql memory? Is amazon simply counting on the bet that users will never fully utilize an instance?


Thanks in advance



=20
= --Apple-Mail-5CA664DD-7DBA-47DD-8E24-10EB10927178--