Significance of using the connection pool

Source: Internet
Author: User

I have always said this: not all applications require a connection pool. Generally, a connection pool is used for lightweight purposes, which will reduce the efficiency. how to connect the pool depends on your system bottleneck.
In a common Connection process, local methods are generally used for Connection, which consume system resources very much. link initialization, execute SQL statements, close links in a common link, the total resource allocation should be, 10, 25, of course not so accurate, only to demonstrate that the resources consumed by the real language execution in a link are very small.
If your server is connected only once every five minutes, you can only use this common connection because the entire connection process is only 0.0 seconds, you do not need to enable the connection pool to consume resources in the remaining 4.9 seconds. However, if there are 10 connections per second, the initialization resources consumed by normal connections are high, you can use the connection pool to show its advantages.
So what connection method should you use? It depends on your application and you must perform real concurrency simulation tests. don't believe what the book says in a good way. The true architecture of a platform is an art, not just a technology. You need to test in many aspects to find the best combination. many traps cannot be discovered by technology. for example, you can check that your JVM has many idle resources, but the system has crashed. the JVM does not reflect the consumption of resources such as link initialization in the local method, but there are many such traps in the same physical memory. What is important is experience and testing!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.