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
thread pool and database connection pool
最新推荐文章于 2024-12-02 00:11:20 发布
本文通过测试结果展示了不同数据库连接管理策略的性能表现,其中“单主线程、每个NE/SQL一个连接”的方式表现最差,而使用连接池的方式则显著提升了效率,仅消耗最差情况约25%的时间。文章还提供了关于连接池的开源软件建议,并介绍了MySQL配置及连接管理的相关命令。

3213

被折叠的 条评论
为什么被折叠?



