O'Reilly logo

Release It! by Michael T. Nygard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Pattern10.1 Pool Connections

As I mentioned in Antipattern 9.1, Resource Pool Contention, resource pools can dramatically improve capacity. Resource pools eliminate connection setup time. Establishing a new database connection requires a TCP connection, database authentication, and database session setup. Taken together, this can easily take 400 to 500 milliseconds. Only starting a new thread is more expensive than creating a database connection.

In the early days of Perl CGI scripts, a script would open a connection, do some work, and then tear down the connection. This strategy was safe, clean, and easy to debug. Unfortunately, this approach hits ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required