Friday, May 24, 2019

[google-cloud-sql-discuss] Cloud Functions -> Cloud SQL via Socket Factory too slow

    So I'm connecting from Cloud Functions for Java in us-central1 to Cloud SQL (postgres 11) in us-west1 using the socket factory approach ('com.google.cloud.sql:postgres-socket-factory:1.0.13'). Everything works, but it takes around ~10 seconds to first obtain the connection, which is the problem. I am spanning two locations, but I didn't think it'd make that much of a difference. Here are the key log entries and the amount of time each one takes. Is this inline with what everyone else is seeing too? I haven't tried creating my own client cert yet but was hoping to avoid managing that.
    • 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].
    Any insight appreciated.
    Hans

    --
    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/222fd37a-aa39-446d-b616-b6ae08bdcdcc%40googlegroups.com.

    No comments:

    Post a Comment