Why calling the Oracle from ODP.Net decrease the throughput of my asp.net webapi core by 1525%?

177 Views Asked by At

I am doing some research in order to increase the performance of my asp.net webapi core (5.0) when working with an oracle (12g) database. I have made two endpoints for tests purpose in this API :

  1. Raw helloworld api endpoint :

    this endpoind will only send back a helloworld string. This is a trivial code.
    
  2. Oracle Odp.Net api endpoint : in this endpoint I am opening an oracle connection retrieve the version of oracle and send back this response to the client.

The code used is this one :

 string constr = "user id=scott;password=tiger;data source=oracle;CONNECTION LIFETIME=90000;MAX POOL SIZE=300;MIN POOL SIZE=20;INCR POOL SIZE=5;DECR POOL SIZE=3";
    OracleConnection con = new OracleConnection(constr);
    con.Open();
    string connectionVersion =  con.ServerVersion;
    con.Dispose();

For my tests, I had also changed some settings :

  • ThreadPool : 100 wordkerThread and 100 iocpThread
  • Database max process : 500

The problem that I have, is that I am observing the following results under load with 500 client threads hammering my API :

  1. Api endpoint 1 (raw helloworld) : 13 000 request/second

  2. Api endpoint 2 (using odp.net) : 800 request/second

After doing some profiling, I had found that most of the time is spent on the SocketPal.Receive method (surely used by ODP.Net) : Performance profiling

How could I get a better throughtput when using oracle with odp.net ?

Is it normal that this throughtput is divided by almost 15,5 (this is a loss of nearly 1525%) ?

0

There are 0 best solutions below