Friday, January 19, 2018

[google-cloud-sql-discuss] Re: Feature request: Increase connection limit on Postgres instances to enable Cloud Functions "API server" backed by Postgres

This connection limit is not a Google limitation, but a limit enforced and recommended by MySQL. Optimal query performance and time depends on how busy your server is and how powerful its hardware is. Since the amount of work connections to your server performs cannot be controlled, and there is no QPS limit on your connections, enforcing a limit to the amount of connections is the best way to ensure a level or reliability between connection performance. 

Instead of opening up more connections to your server (in turn making it more busy and slow), it is recommended to create a Connection Pool.  There are many third-party Connection Pool libraries out there that you can use. The general idea is that each of your clients (aka Cloud Functions) will check the connection pool for an available connection. The pool has a limited number of connections (e.g 100), and if they are all used up your client will perform exponential backoff retry (e.g for Cloud Storage) to wait for an available connection. Once a connection becomes free, your client will use the available connection. Once it is done, your client simply returns the connection back into the pool instead of closing it. 

- Note, Google Groups is for general product discussions and not for technical support. If you require further technical support for creating a connection pool it is recommended to post your detailed questions to Stack Overflow using the supported Cloud tags. 


--
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/dc07e4cc-02db-46e5-86bc-e9669a0887e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment