Friday, August 23, 2019

Re: [google-cloud-sql-discuss] Re: Cloud MySQL Free Memory

MySQL will use as much memory for caching as it can. If MySQL needs memory, cached objects will be evicted.  Trying to manage MySQL memory is not a good idea. Pick an instance size to meet your performance requirements.

Again, I don't understand what problem you are trying to solve.

Where did you come to believe that MySQL queries will fail if the cache is full? Why do you think forcing a cache flush will improve anything? MySQL will (usually) be happy to use the disk albeit at lower performance than memory. If a query requires more physical memory than the instance has, then your only real option is to scale up. Flushing the cache will not achieve this.

On 8/23/2019 8:10:29 PM, Devin Homan <devin@flyntlok.com> wrote:

John,

If a SQL operation requires more free memory than is available, the operation will fail but the memory will be freed.  The memory usage does ideally sit at around 80%, but I've had it go above 90% and then go back down to 20%.  The number of connections isn't an issue and the connections are pooled; many of the connections being closed is just what I've had happen when the memory goes back down. I'm guessing this is a behavior that Google has implemented behind the scenes as I cannot find documentation of it, and that the system does this because there is no swap space/virtual memory and running out of memory can cause operating system problems.   It would be nice if I could have a nightly process that triggered this behavior so that there weren't tables cached in memory that may not be needed the next day.   Restarting the database has the same effect, plus more, with more disruption, obviously.  I would think that
FLUSH TABLES

would have this effect, but it does not.  There may be more standard ways of getting MySQL to give-up the memory but it seems that there is already a behind-the-scenes feature for Cloud MySQL to get it to do that.

On Friday, August 23, 2019 at 6:13:48 PM UTC-8, Devin Homan wrote:
Is it possible to tell MySQL to free-up memory?  When the memory usage gets to a certain point, say 95% used,  Google Cloud MySQL will automatically free the memory and close most connections. Is there any way to manually trigger this behavior?

--
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/b56b3ff9-6eb2-4c49-803d-fc8e3fba970e%40googlegroups.com.

--
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/6e44617c-5b6d-48f3-911c-cddf9e07f77c%40getmailbird.com.

No comments:

Post a Comment