How to avoid 'communications link failure'

615 views
Skip to first unread message

Baik JoongWon

unread,
Apr 29, 2016, 7:29:42 AM4/29/16
to Google App Engine

I'm using Google App Engine + Google Cloud SQL + Spring Data JPA in my application.

The following error message often appears.

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

I know that because of DB connection pool.
However, it is difficult to solve because of GAE restrictions.

I'm using Common DBCP 1.4
I would like to use Evictor Option. but, thread creation behavior is restricted from GAE.

Reluctantly it was forced to use the testOnBorrow + validationQuery options.

testOnBorrow : true (default value is false)
validationQuery : SELECT 1

I thought I had solved this problem.
But it still happens.

Please somebody tell me that how to avoid above error message and
testOnBorrow option how much reduction in performance.

Help me.

Nick (Cloud Platform Support)

unread,
Apr 29, 2016, 3:33:40 PM4/29/16
to Google App Engine
Hey Baik,

I'll be happy to attempt to assist from a general standpoint, and hopefully as the thread evolves we can get more into specifics. 

In general, communications link failures are to be expected in a distributed computing environment, and cannot entirely be prevented. There are connection pooling methods, some, as you're using, integrated into libraries, and there are also defensive methods such as exponential back-off retry logic. 

As far as performance impacts, these can either be reasoned about in the abstract (usually an incredibly difficult task), or benchmarked in practice, which is what I highly recommend when it comes to real-world systems.  

I'm interested to know more about what difficulties you ran into when using connection pooling, specifically which GAE restrictions came into effect and how?

Sincerely,

Nick
Cloud Platform Community Support
Reply all
Reply to author
Forward
0 new messages