You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the RSA pair is generated even when not needed (i.e. unix socket) - this is causing a big delay in the initial connection (likely similar to #53). We should figure out how to speed this up, or generate the key-pair asynchronously to prevent it from blocking until it needs to.
We are affected by this and here are some more details: I'm connecting from Cloud Functions for Java in us-central1 to Cloud SQL (postgres 11) in us-west1 using the socket factory. Everything works, but it takes around ~10 seconds to first obtain the connection, which is the problem. I am spanning two locations, but don't think it'd make that much of a difference. Here are the key log entries and the amount of time each one takes.
6 ms: INFO: Connecting to Cloud SQL instance [projectid:us-west1:instancename] via SSL socket.
7 sec: INFO: First Cloud SQL connection, generating RSA key pair
3 sec: INFO: Obtaining ephemeral certificate for Cloud SQL instance [projectid:us-west1:instancename]...
1 sec: INFO: Connecting to Cloud SQL instance [projectid:us-west1:instancename] on IP [public ip].
I have forced it to use a Unix socket via the environment variable, but it doesn't improve the situation, and most importantly, it still generates the RSA key pair, which takes up the majority of the time. We are using this with a UI app, and getting that SQL connection up as fast as possible is very important to us.
Add automatic use of the functions
/cloudsql/
socket.The text was updated successfully, but these errors were encountered: