求助!用java对mysql压力测试中并发连接>500,数据量>30000时报Communications link failure
MySQL版本:5.5.22 for Linux (x86_64)
设置了max connections=1000
写了一个Java程序,会同时启动500个线程操作数据库,每个线程保持一个Connection
500个线程要总共向数据库insert 30000条数据时,抛了下面的异常。
500线程*10000数据和200线程*100000数据的测试都通过了。
用最简单的
conn = DriverManager.getConnection(path, username,password);
获取的连接。
试过用2台电脑,每台跑300个并发,也会出现同样的错误
感觉是MySQL哪的配置有问题,但就是百思不得其解!
百度相似的错误有人说是连接time out的问题,但是我程序启动就连接数据库并执行测试了,然后就出现异常,并不是在等待较长时间之后执行的测试。
求高人指点迷津!!先谢过了!
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 19,176 milliseconds ago. The last packet sent successfully to the server was 19,176 milliseconds ago.