In general, the concern about "exhausting system resources" applies to both the application server and the database server. The more database connections you allow, the more concurrent sessions are running on the application server(s), the more RAM the application server(s) VM requires, the more demand is placed on CPUs on application servers and database servers, etc. If the queue of backlogged work gets too big, you may find yourself spending more time swapping processes on and off the CPU and scheduling tasks than in doing useful work. A maximum size on the connection pool allows you to handle an avalanche of traffic or an unexpected performance bottleneck slightly more gracefully by quickly erroring out rather than letting users time out waiting for replies that will never come.
Databases do, in general, have the ability to limit the number of connections they support. Oracle has PROCESSES
and SESSIONS
parameters, for example, and supports multiple connection architectures (dedicated server and shared server) to let you trade off performance against resource consumption to increase the number of concurrent connections the database can support.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…