Connection pooling options with JDBC: DBCP vs C3P0

前端 未结 16 1862
遥遥无期
遥遥无期 2020-11-22 06:17

What is the best connection pooling library available for Java/JDBC?

I\'m considering the 2 main candidates (free / open-source):

  • Apache DBCP - http:/
16条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 06:51

    my recommendation is

    hikari > druid > UCP > c3p0 > DBCP

    It's based on what I have tested - 20190202, in my local test environment(4GB mac/mysql in docker/pool minSize=1, maxSize=8), hikari can serve 1024 threads x 1024 times to get connections, average time for each thread to finish is 1 or 2 million seconds, while c3p0 can only serve 256 threads x 1024 times and average time for each thread is already 21 million seconds. (512 threads failed).

提交回复
热议问题