Sie sind auf Seite 1von 2

Database Connections 1. Obtain a connection from a connection pool. 2. Create a new connection one at a time as needed.

The right choice made depends mainly on CPU and memory conditions on the database server. Important Facts about Connection Pools: 1. Creating a connection is performance-expensive compared to all other tasks a database application can perform. 2. Open connections use a sustainable amount of memory on both the database server and database client machines. 3. Establishing a connection takes multiple network round trips to and from the database server. 4. Opening numerous connections can contribute to out-of-memory conditions, which might cause paging of memory to disk, thus overall performance degradation. 5. Many applications are deployed in connections pooled environments, which are intended to improve performance. Many times poorly tuned connection pooling can result in performance degradation. Connection pools can be difficult to design, tune and monitor. The path of connection pools typically involves many network round trips between the driver and the database server. (Example: Driver connections used in Oracle/Sybase take anywhere from 7 to 10 network round trips to perform the following actions: Validate users credentials Negotiate code page settings between what the database driver expects and what the database has available Get database version information Establish optimal database protocol packet size to be used for communication Set session settings DBMS establishes resources on behalf of the connection (performance is expensive due to disk I/O and memory allocation)

Is there a Benefit to placing the application on the same server as the database system? Not realistic as many applications accessing many database systems with applications running on several application servers. Database system server must be well tuned for the database, not for many different applications. What about a single point of failure?

How Connection Pooling Works Step 1: When the application or application server is started, the connection pool is typically populated with connections. Step 2: The application makes a connection request. Step 3: Depending on the architecture, either the driver or connection Pool manager assigns one of the available pooled connections to the application instead of requesting a new connection to be established. (No network round trips occur between the driver and database server for connection) RESULT: FAST connection request! Step 4: Application is connected to the database Step 5: When the connection is closed, its placed back into the pool.

Das könnte Ihnen auch gefallen