thread pool and database connection pool

本文通过测试结果展示了不同数据库连接管理策略的性能表现。单线程单连接方式性能最差,而采用连接池技术可以显著提升效率,仅消耗最佳情况下的25%时间。文中还介绍了几种开源的JDBC连接池方案,并提供了MySQL配置和连接管理的相关链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The test result shows the “one main thread, one connection per NE/per sql” performs worst, and “thread pool, shared one connection” improves, but a little. And with database conection pool, it improves amazingly, it only use about 25% time of the worst case.

Some notes about the database connection pool.

1) open source software for JDBC connection pool
http://baike.baidu.com/view/84055.htm
note: apache DBCP do not use
suggest c3p0.

2) mysql show configurations
http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_max_connections
for example: SHOW VARIABLES;
max_connections default value is 100.

3) mysql show connections
http://dev.mysql.com/doc/refman/5.5/en/show-processlist.html
for example: show processlist;

4) mysql kill connection
http://dev.mysql.com/doc/refman/5.5/en/kill.html
for example: kill 19024


here are some links from net,

1) http://hi.baidu.com/tlw_ray/blog/item/c9c3052d81cc1636359bf7e7.html
2) http://abaper.blogbus.com/logs/109435878.html
3) http://jolbox.com/ bonecp



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值