Tuesday, October 31, 2017

Re: [google-cloud-sql-discuss] Re: Excessive Memory Usage - Postgres

Hi Mike,

What is your instance size?
Most likely cause of memory usage is PostgreSQL's shared_buffers. It is expected that around 1/3rd of the memory will be used by them pretty much all the time. Memory usage will be low immediately after restart since shared_buffers will be empty, but this is expected to grow over time.
PostgreSQL does not discard any 'old' contents of shared_buffers since they may be still useful, which should explain why usage continued to stay high after import even though instance was idle.

Please let us know if you see memory usage of more than a third of the total memory on idle instance.

Thank you!

--
Vladimir Rusinov
PostgreSQL SRE, Google Ireland

Google Ireland Ltd.,Gordon House, Barrow Street, Dublin 4, Ireland
Registered in Dublin, Ireland
Registration Number: 368047

On Mon, Oct 30, 2017 at 7:37 PM, Mike Hardy <mhardy@localinsights.io> wrote:
Hi George, memory usage stayed high until I restarted the instance. That's not practical when we're in production.

The Cloud SQL FAQ resource seems related to billing, which I have no doubts about. We plan to use this instance continuously with no/minimal downtime.

On Monday, October 30, 2017 at 12:33:08 PM UTC-7, George (Cloud Platform Support) wrote:
Hello Mike, 

Is memory usage still high in value right now? If your instance hasn't been in use for a while, and the activation policy value is set to "ON_DEMAND", there will be little memory usage shown prior to actual use, in your case the backup restore operation. Your instance remains up for 15 minutes after the completion of the last access, so you won't notice an immediate drop in memory usage. This is documented in the "How is use of my instance calculated?" sub-chapter of the "Cloud SQL FAQ" online document

For the actual tuning of your PostgreSQL database, you may have a look at the "18.4. Resource Consumption" page of the PostgreSQL documentation. 

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/3988ec70-98f2-46c0-80a3-acf0118391c5%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/CAE1wr-zGkJmQaiaPt%3Dg82ZtE8%2B%3Dc9uiVknop2Yw%2Bm9r1sqh6vA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment