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 发布