Reputation: 107
There is a complex object that contains couple of children objects.
if populate each of them separately, for example, in the C# Unit Test performance of Oracle DB is very good , each request from C# to Oracle DB takes 20-40 ms to complete. But if combine these classes/objects to "parent" object as children, the performance dramatically decreased. There is a log below populated by dotTrace.
In the program exists ConnectionManager that returns the OracleConnection object. If there is couple of requests, it does not close the connection but returns existing one. If there is no requsts it closes the connection
It shows very good performance in unit test for individual objects.
It looks like Oracle.ManagedDataAccess does not work "async" and if we have couple of requests at the same time these requests "hangs" in a queue...
Is it make sense to create a pool of opened Oracle Connections (3-4) and keep all of them alive and dynamically return one of them to a requester , mark it "is in use", return next one that is NOT "is in use" for next request etc?
Will it increase performance of the database calls ?
will it be "async" ? Or anyway Oracle.ManagedDataAccess will work in a "sync" mode and every conenction will wait until another connection returns a resultset?
15,80 % Open • 1 754 ms • 1 call • Oracle.ManagedDataAccess.Client.OracleConnection.Open
15,80 % Get • 1 754 ms • 1 call • OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString, PM, ConnectionString, SecureString, SecureString, OracleConnection)
15,80 % Get • 1 754 ms • 1 call • OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString, Boolean, OracleConnection, String, Boolean)
15,80 % Get • 1 754 ms • 1 call • OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString, Boolean, OracleConnection, String, Boolean)
15,80 % CreateNewPR • 1 754 ms • 1 call • OracleInternal.ConnectionPool.OraclePoolManager.CreateNewPR(Int32, Boolean, ConnectionString, OracleConnection, String, List)
15,80 % CreateNewPR • 1 754 ms • 1 call • OracleInternal.ConnectionPool.PoolManager`3.CreateNewPR(Int32, Boolean, ConnectionString, OracleConnection, String, List)
15,80 % Wait • 1 753 ms • 1 call • System.Threading.ManualResetEventSlim.Wait(Int32, CancellationToken)
0,00 % UpdateStateAtomically • 0 ms • 2 calls • System.Threading.ManualResetEventSlim.UpdateStateAtomically(Int32, Int32)
0,00 % get_IsSet • 0 ms • 1 call • System.Threading.ManualResetEventSlim.get_IsSet
0,00 % EnsureLockObjectCreated • 0 ms • 1 call • System.Threading.ManualResetEventSlim.EnsureLockObjectCreated
0,00 % Dispose • 0 ms • 1 call • System.Threading.CancellationTokenRegistration.Dispose
0,00 % set_Waiters • 0 ms • 2 calls • System.Threading.ManualResetEventSlim.set_Waiters(Int32)
0,00 % ThrowIfDisposed • 0 ms • 1 call • System.Threading.ManualResetEventSlim.ThrowIfDisposed
0,00 % InternalRegisterWithoutEC • 0 ms • 1 call • System.Threading.CancellationToken.InternalRegisterWithoutEC(Action, Object)
0,00 % 8 functions hidden • 0 ms total • 10 calls total
0,00 % 2 functions hidden • 0 ms total • 2 calls total
0,00 % 13 functions hidden • 0 ms total • 14 calls total
0,00 % 2 functions hidden • 0 ms total • 2 calls total
0,00 % 20 functions hidden • 0 ms total • 32 calls total
#stacktrace
Upvotes: 0
Views: 562