Cloud SQL的间歇性通信链接失败 [英] Intermittent Communications link failure with Cloud SQL

查看:188
本文介绍了Cloud SQL的间歇性通信链接失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 jmeter 来压力测试使用CloudSQL的GAE Web服务,并且我收到间歇性通信链接失败异常。

我尝试过使用直接连接和连接池,在任何一种情况下都会看到异常。随着每秒请求次数的增加,异常会增加。注意,我们使用的是最高层的云端SQL,D32,并且测试的最大连接数低于3200。 。



以下是供参考的堆栈跟踪:

 发送的最后一个数据包成功到服务器是0毫秒前。驱动程序尚未收到来自服务器的任何数据包。 
在sun.reflect.GeneratedConstructorAccessor48.newInstance(来源不明)
在sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
在java.lang.reflect.Constructor.newInstance( Constructor.java:33)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1117)
at com.mysql.jdbc.MysqlIO。< init>(MysqlIO.java:350)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2413)
at com。 mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2450)
。在com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2235)LT
。在com.mysql.jdbc.ConnectionImpl&; INIT>(ConnectionImpl.java:818)
。在com.mysql.jdbc.JDBC4Connection<初始化>(JDBC4Connection.java:46)
。在sun.reflect.GeneratedConstructorAccessor46.newInstance(未知来源)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Dele gatingConstructorAccessorImpl.java:45)
在java.lang.reflect.Constructor.newInstance(Constructor.java:33)
在com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
。在com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:404)
在com.mysql.jdbc.GoogleNonRegisteringDriver $ JdbcWrapper.getInstance(GoogleNonRegisteringDriver.java:276)
在com.mysql .jdbc.GoogleNonRegisteringDriver.connect(GoogleNonRegisteringDriver.java:246)
在java.sql.DriverManager.getConnection(DriverManager.java:571)
在java.sql.DriverManager.getConnection(DriverManager.java:215 )

更新:我将连接池设置更改为maxActive = 5和maxIdle = 5,链接例外消失。请注意,我已经尝试了commons dbcp和tomcat dbcp。我现在在日志中看到以下例外情况:



原因:java.sql.SQLException:java.lang.SecurityException:无法访问gatherPerformanceMetrics



导致:java.sql.SQLException:java.lang.SecurityException:无法访问includeThreadDumpInDeadlockExceptions

sql.SQLException:java.lang.SecurityException:无法访问nullNamePatternMatchesAll

解决方案

From https://cloud.google.com/appengine/docs/java/cloud-sql/#Java_Size_and_access_limits



每个App Engine实例的Google Cloud SQL实例的并发连接数不能超过12个。



你能告诉更多关于测试设置吗? jmeter发送到appengine的请求数量以及应用程序实例为每个请求打开多少个连接?


I'm using jmeter to stress test a GAE web service which uses CloudSQL and I'm getting intermittent communications link failure exceptions.

I've tried using direct connections and a connection pool, and I see exceptions in either scenario. The exceptions increase as the number of requests per second increase.

Note that we are using the highest tier of cloud sql, D32 and the tests are well under the max 3200 connections.

Here's a stack trace for reference:

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.GeneratedConstructorAccessor48.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:33)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1117)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:350)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2413)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2450)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2235)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:818)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
at sun.reflect.GeneratedConstructorAccessor46.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:33)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:404)
at com.mysql.jdbc.GoogleNonRegisteringDriver$JdbcWrapper.getInstance(GoogleNonRegisteringDriver.java:276)
at com.mysql.jdbc.GoogleNonRegisteringDriver.connect(GoogleNonRegisteringDriver.java:246)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:215)

Update: I changed the connection pool settings to maxActive = 5 and maxIdle = 5 and the intermittent communications link exceptions went away. Note that I've tried commons dbcp and tomcat dbcp. I'm now seeing the following exceptions in the logs:

Caused by: java.sql.SQLException: java.lang.SecurityException: Unable to access gatherPerformanceMetrics

Caused by: java.sql.SQLException: java.lang.SecurityException: Unable to access includeThreadDumpInDeadlockExceptions

Caused by: java.sql.SQLException: java.lang.SecurityException: Unable to access nullNamePatternMatchesAll

解决方案

From https://cloud.google.com/appengine/docs/java/cloud-sql/#Java_Size_and_access_limits

"Each App Engine instance cannot have more than 12 concurrent connections to a Google Cloud SQL instance."

Can you tell more about the test set-up? How many requests is jmeter sending to appengine and how many connections does the app instance open for each of those requests?

这篇关于Cloud SQL的间歇性通信链接失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆