-
Notifications
You must be signed in to change notification settings - Fork 8.6k
linux benchmark
wenshao edited this page Dec 14, 2012
·
43 revisions
这个测试的目的是验证当前常用数据库连接池的性能。
Connection conn = dataSource.getConnection();
PreparedStatement stmt = conn.preparedStatement("select 1");
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
}
rs.close();
stmt.close();
conn.close();
-
test config
property | value |
initialSize | 10 |
minPoolSize | 10 |
maxPoolSize | 50 |
测试各种并发场景下执行申请1,000,000(一百万)次总耗时的性能对比。
#环境
- OS linux 3.5.0-19-generic X86_64
- CPU XEON E5-2450 双路共16核32物理线程
- Memory 48G
- JDK 1.7.0_10
耗时(毫秒) | 物理连接创建次数 | 有错误 | |
druid | 273 | 10 | |
tomcat-jdbc | 398 | 10 | |
dbcp | 636 | 11 | |
jboss-datasource | 1,470 | 10 | |
boneCP | 3,070 | 51 | |
c3p0 | 4,035 | 50 | |
proxool | 4,983 | 10 |
耗时(毫秒) | 物理连接创建次数 | 有错误 | |
druid | 931 | 10 | |
tomcat-jdbc | 2,157 | 10 | |
dbcp | 4,012 | 11 | |
jboss-datasource | 2,499 | 10 | |
boneCP | 2,324 | 51 | |
c3p0 | 6,429 | 50 | |
proxool | 5,462 | 10 |