Plsql_ Performance Optimization series 12_oracle Connection Management

Source: Internet
Author: User
Tags connection pooling

2014-09-25 Baoxinjian

I. Summary

In the Official document "Oracle Performance Tuning Guide", mention connecting to the database was an expensive operation, which is highly unscalable.

Database connection operations are expensive and difficult to scale (large concurrency support).

Feel the last database login operation is an instant thing, how expensive is it?

Simply put, the listener receives a remote connection request and forwards it to the server process;

For each session database, a server process is generated to allocate memory for the session, authentication, auditing

In addition, in one session, cursors can be reused in a number of ways,

such as the Plsql program,

All static SQL is cache, and repeated calls do not soft parse;

Sometimes you can set the Session_cached_cursor parameter to reduce soft parse.

Therefore, if a program uses short connections, frequent logon/logoff are not available for these features. This is another disadvantage of short connections.

While this is a very straightforward question, designers should have the concept of ' connection management ' to avoid the dangers of short connections. On a production system, we can still see short connections:

grep ' <txt>22-oct-2012 14:47 ' LOG.XML|WC

102 1220 18141

With more than 100 connections per minute, just processing the connection request may consume half the CPU.

Second, connection management

So how to manage the connection in the application design?

(1) Simple application, or the application of C/s structure, the connection is established when the application is started (interface Open), the connection is terminated when the application is closed. This normally allows an endpoint to initiate 1-2 connections in 1 days.

(2) Java programs can use connection pooling, which can be shared among multiple threads.

(3) Most systems currently employ middleware (WebSphere, WebLogic), using a connection pool (connection pool), each time a request is initiated, the connection handle is obtained from the connection pool, and no new connections need to be established continuously.

Reference: Baidu Library information

Plsql_ Performance Optimization series 12_oracle Connection Management

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.