我是靠谱客的博主 小巧手套,最近开发中收集的这篇文章主要介绍Vertica修改最大并发连接数,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

本文地址:http://blog.csdn.net/kongxx/article/details/7176961

最近在对Vertica做压力测试的时候,发现当并发请求数达到50+的时候就会出现下面的异常

com.vertica.util.PSQLException: FATAL: New session rejected due to limit, already 55 sessions active at com.vertica.core.v3.ConnectionFactoryImpl.readStartupMessages(Unknown Source) at com.vertica.core.v3.ConnectionFactoryImpl.openConnectionImpl(Unknown Source) at com.vertica.core.ConnectionFactory.openConnection(Unknown Source) at com.vertica.jdbc2.AbstractJdbc2Connection.<init>(Unknown Source) at com.vertica.jdbc3.AbstractJdbc3Connection.<init>(Unknown Source) at com.vertica.jdbc3g.Jdbc3gConnection.<init>(Unknown Source) at com.vertica.Driver.makeConnection(Unknown Source) at com.vertica.Driver.connect(Unknown Source) at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582) at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1181) at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at DBUtil.getConnection(DBUtil.java:64) at DBQueryPerformanceTest.query(DBQueryPerformanceTest.java:46) at DBQueryPerformanceTest.access$000(DBQueryPerformanceTest.java:14) at DBQueryPerformanceTest$1.execute(DBQueryPerformanceTest.java:40) at DBPerformanceTest.runIt(DBPerformanceTest.java:97) at DBPerformanceTest$1.run(DBPerformanceTest.java:51) at java.lang.Thread.run(Thread.java:619) com.vertica.util.PSQLException: The connection attempt failed. at com.vertica.core.v3.ConnectionFactoryImpl.openConnectionImpl(Unknown Source) at com.vertica.core.ConnectionFactory.openConnection(Unknown Source) at com.vertica.jdbc2.AbstractJdbc2Connection.<init>(Unknown Source) at com.vertica.jdbc3.AbstractJdbc3Connection.<init>(Unknown Source) at com.vertica.jdbc3g.Jdbc3gConnection.<init>(Unknown Source) at com.vertica.Driver.makeConnection(Unknown Source) at com.vertica.Driver.connect(Unknown Source) at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582) at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1181) at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at DBUtil.getConnection(DBUtil.java:64) at DBQueryPerformanceTest.query(DBQueryPerformanceTest.java:46) at DBQueryPerformanceTest.access$000(DBQueryPerformanceTest.java:14) at DBQueryPerformanceTest$1.execute(DBQueryPerformanceTest.java:40) at DBPerformanceTest.runIt(DBPerformanceTest.java:97) at DBPerformanceTest$1.run(DBPerformanceTest.java:51) at java.lang.Thread.run(Thread.java:619) Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:237) at com.vertica.core.PGStream.ReceiveChar(Unknown Source) at com.vertica.core.v3.ConnectionFactoryImpl.doAuthentication(Unknown Source) ... 19 more 出现这个问题是由于Vertica中指定了MaxClientSessions参数,此时可以通过下面的SQL来修改此值

SELECT SET_CONFIG_PARAMETER ('MaxClientSessions', 250);








最后

以上就是小巧手套为你收集整理的Vertica修改最大并发连接数的全部内容,希望文章能够帮你解决Vertica修改最大并发连接数所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(54)

评论列表共有 0 条评论

立即
投稿
返回
顶部