What really is connection pooling?

后端 未结 6 910
灰色年华
灰色年华 2021-02-01 18:49

I have heard the term connection pooling and looked for some references by googling it... But can\'t get the idea when to use it....

  • When should i consider usin

6条回答
  •  执笔经年
    2021-02-01 19:21

    When should i consider using connection pooling?

    • Always for production system.

    What are the advantages and disadvantages of connection pooling?

    Advantages:

    • Performance. Use a fixed pool of connection and avoid the costly creation and release of connections.
    • Shared infrastructure. If your database is shared between several apps, you don't want one app to exhaust all connections. Pooling help to limit the number of connection per app.
    • Licensing. Depending on your database license, the number of concurrent client is limited. You can set a pool with the number of authorized connections. If no connection is available, client waits until one is available, or times out.
    • Connectivity issue. The connection pool that is between the client and the database, can provide handy features such as "ping" test, connection retry, etc. transparently for the client. In worse case, there is a time-out.
    • Monitoring. You can monitor the pool, see the number of active connections, etc.

    Disadvantage:

    • You need to set it up and configure it, which is really peanuts usually.

提交回复
热议问题