Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Relation between Oracle session and connection pool

Tags:

Let me explain the set up first.

We have an oracle server running on a 2GB RAM machine. The Db instance has the init parameter "sessions" set to 160.

We have the application deployed on Websphere 6.1. The connection pool settings is Min 50 and Max 150.

When we run Load test on 40 Users (concurrent, using jMeter), everything goes fine. But when we increase the concurent users to Beyond 60, Oracle throws and exception that it is out of sessions.

We checked the application for any connection leaks but could not find any.

So does it mean that the concurrency of 40 is what this setup can take ? Is increasing the Oracle sessions/process the only way to obtain higher concurrency ?

How exactly are the DB sessions and Connection in the Connection pool related ? In my understanding, the connections cannot exceed the sessions and so setting the Max Connection pool to more than sessions may not really matter. Is that correct ?

like image 260
Sathya Avatar asked Jun 24 '09 17:06

Sathya


People also ask

What is the difference between connection and session in Oracle?

A connection is a network, physical connection between you and Oracle database. A connection might be of two types: DEDICATED server and SHARED server. A session encapsulates user interaction with the database, from the moment user was authenticated until the moment the user disconnects.

What is difference between session and connection?

You can create a connection from one device to another device. Within the connection, you can have several sessions with the same remote device. For example, if you have a multi-monitor setup, one session will display one monitor screen.

What is connection pool session?

Each connection in the connection pool has its own session pool. This means that there can be 10 session pools that can have a maximum of 10 sessions each. Each session represents a TCP/IP connection to the queue manager. With the settings mentioned here, there can be a maximum of 100 TCP/IP connections.

What is the difference between connection and connection pool?

Instead of opening and closing connections for every request, connection pooling uses a cache of database connections that can be reused when future requests to the database are required. It lets your database scale effectively as the data stored there and the number of clients accessing it grow.


2 Answers

Check out this book on google books. It explains the differences between connections and sessions.

like image 99
mamboking Avatar answered Oct 20 '22 07:10

mamboking


Metalink gives the following advice about the SESSIONS parameter:

Recursive sessions are an essential part of the normal functioning of the RDBMS. It is impossible to identify every circumstance that would require such sessions, but in general, if a user-initiated operation requires the manipulation of data dictionary objects, then recursive sessions may get created. To take a simple example, say you create a table while logged in as some ordinary user. Behind the scenes this has to insert rows into obj$, tab$ etc which are owned by the SYS user. Since a normal user would have no privilege to insert into these objects, a recursive session is created which logs in as SYS.

Solution:

Increase the SESSIONS parameter.

Recommendation is to preserve 50% of the SESSIONS value for recursive sessions. So, for example if it is expected to have 30 client sessions open, then set the SESSIONS parameter to 60.

So, depending on what websphere and your user process are doing this could partially explain what you're seeing.

like image 40
DCookie Avatar answered Oct 20 '22 05:10

DCookie