-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiple pool.getConnection - takes more time to release connection #398
Comments
Dig a little deeper
|
@sivacreatives Please provide a reproducible test case. You're pretty close, but the code you supplied only invokes getConnection once and thus doesn't reproduce the issue your describing. My guess is you're running into the same issue described here: |
1). Changed poolmin to 10 and pooltimeout 0
Increasing the poolMin value greater than 2 or setting poolTimeout to 0 fixes this issue. max response time 200ms 2). Changed poolmin : 1 and pooltimeout: 10 - release time and get conn time increases for subsequent request.
However, From my above configuration poolmin : 1, if I try to open 2 connections parallely, From poolIncrement value 2 it has to open two new connections and thus it becomes 3 open connections now. so, when releasing one connection, it closes opened 2 incremented connection ? or only that particular incremented connection ? The above setting takes 18s to release the connection not for the first time but for subsequent request. For the first time response comes with in milli seconds. 3).Changed pooltimeout : 1 - Release time and get coon max takes 2s. for subsequent request - average performance
The above settings(changed pooltimeout to 1) takes 2s to release the connection not for the first time but for subsequent request. For the first time response comes with in milli seconds. Final Question : Pooltimeout terminates only the Incremented idle connection or all open connection including the minimum opened connection ? |
Having looked a a few cases, the devil is in the details. In particular see my previous question about what you are measuring. |
1). Are you sure it's not the creation of the initial connections that is taking time? Have you 'warmed up' the pool before starting timings?] - 2). How did you determine you needed a low 10s pool timeout? - 3). Check the pool queue stats - 4).How are you invoking the getConnection() method? Check whether you have thread contention: do you need to increase UV_THREADPOOL_SIZE- Well, Without increasing the thread and by making the poolmin size 20, response time its fast. I dont see any changes when I try to increase thread size when am having the poolmin:1 5).Are you using DRCP? The initial session creation profile can differ from non DRCP, so the cost occurs later. We are not using DRCP |
@sivacreatives the more high level description given, the more confusing it is to work out exactly what you are running, and how you are measuring results. Sounds like you need to simplify what you are experimenting with and take it back to a basic, single file test. |
Thanks for your reply @cjbj poolmin : 1 - getting single connection and releasing it has no problem. However, triggering two conn at a time fails. poolmin : 20 : no problem |
@sivacreatives let us know when you have simplified the test case and have posted it. |
@cjbj The above code takes more time to return values for subsequent request. |
|
Hi, Thanks for your reply @cjbj Updating oracle client from 11g to 12c fixes this issue. However, We do not know the reason. Here is the unit test case : unit test case will create three get conn and will release the conn, after pooltimeout time, it will trigger 2 new connections to check the release conn time delay Oracle 11.2.0.2.0 – After POOL_TIME_OUT Releasing the connection took more time and for subsequent get connection waits for the previous releasing time. (Unit test case will fail here) Oracle 12.1.0.2.0 – We did not face any problem with connection pool. (Unit test case will pass) Test case output files are attached for both oracle clients(11.2,12.1). Following are the versions and configuration settings: Python : 2.7.5 Dbconfig:
|
Hi, @cjbj have you had a chance to look into this issue |
From a brief look I think you are seeing the effect of the pool being a shared resource so creating a new connection will block releasing another one. This is likely to be very configuration-specific. My results were different to yours. With the few connections created in your testcase I saw a slow release before the 21s sleep, not after. You should size the pool carefully so the session creation costs can be amortized over a number of getConnection calls. Do you really need so small a |
@sivacreatives if this is answered, I will close it. |
hi @cjbj .. did u use same versions of dependent softwares and oracle client(Instant client) version which I had mentioned above ? using which oracle client version did you face the issue ? bcoz I did not face any issue before timeout threshold. |
I tried various versions on a couple of machines. Results varied. How did you go with adjusting the pool parameters? |
Closing due to lack of activity. |
We are able to get results with in milliseconds If we trigger single pool.getconnection. However, with multiple pool.getConnection at the same time its taking time(10s,20s) to release the connection
Note : When using oracledb.getConnection without pool, everything is fine, even triggering multiple call at same time works fine.
Consider table has 5 rows.
Below is my code.
The text was updated successfully, but these errors were encountered: