Friday, June 21, 2013

Connection setup time >700ms on a google compute engine instance

Hi all

I am trying to connect to my Cloud SQL instance inside a Google compute engine server instance, and we are observing that the setup time for a DB connection is always bigger than 700ms.

Given that not connection pooling is recommend, this makes our REST based app unusable as each request needs to open a new connection to the database and get's the 700ms minimum lag.

Below are the traces of a simple app running on the server instance showing the connection setup phase with the timestamps.

1371812704338 FINE Using cached Access token.
1371812704354 FINE Created client for instance: xxxxx
1371812704359 FINE Executing OpenConnection: null at xxxxx
1371812704377 FINE Sending request to https://www.googleapis.com/sql/v1/jdbc/openConnection?alt=proto
1371812704513 CONFIG -------------- REQUEST  --------------
1371812704516 FINEST ProxySelector Request for https://www.googleapis.com/sql/v1/jdbc/openConnection?alt=proto
1371812704828 FINEST Proxy used: DIRECT
1371812704936 FINEST sun.net.www.MessageHeader@2a9cfec112 pairs: {POST /sql/v1/jdbc/openConnection?alt=proto HTTP/1.1: null}{Accept-Encoding: gzip}{Authorization: Bearer ya29.AHES6ZQrijCM7aJRY5jzsWayAIDp7lwoVFzHbFsVoWr2L2bY9FuYDNs}{User-Agent: Google SQL Service/1.0 Google-HTTP-Java-Client/1.9.0-beta-SNAPSHOT (gzip)}{X-Upload-Content-Length: 0}{Content-Type: application/x-protobuf}{Cache-Control: no-cache}{Pragma: no-cache}{Host: www.googleapis.com}{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}{Content-Length: 66}
1371812704936 FINEST HttpClient.writeRequests() streaming=true
1371812704938 CONFIG
1371812705039 FINEST sun.net.www.MessageHeader@3e018c7412 pairs: {null: HTTP/1.1 200 OK}{Cache-Control: no-cache, no-store, max-age=0, must-revalidate}{Pragma: no-cache}{Expires: Fri, 01 Jan 1990 00:00:00 GMT}{Date: Fri, 21 Jun 2013 11:05:05 GMT}{ETag: "_7wYyDbWr4n6mUP0M5ioyTuAIh4/78JYOhpfkickmRL0KbO9P7pOgNI"}{Content-Type: application/x-protobuf}{Transfer-Encoding: chunked}{X-Content-Type-Options: nosniff}{X-Frame-Options: SAMEORIGIN}{X-XSS-Protection: 1; mode=block}{Server: GSE}
1371812705041 CONFIG -------------- RESPONSE --------------
1371812705042 CONFIG Response size: 75 bytes
1371812705043 CONFIG
1371812705048 FINEST RPC response: connection_id: "\000d\037\r\370x\331\2428\272t\267P\030\340K[\263P\262c\205\260.Vb\262*}\027\314r\305\341;\310\024\306\\\030\323\324Q\003Tp\355\303\242\352\003!\v3^\203/\030`I*\236\030U=\322>x\027;\302$\211"
1371812705122 FINEST Connection: {instance=xxxxx, database=xxxxx}

Is there any way to enhance the connection setup or enable the connection pooling reliably?

Best regards
Sergio

--
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment