Too many Oracle connections open

646 Views Asked by At

I have a .NET Core web api on IIS running and I'm using oracle as database and I do connect to it like this.

using(OracleConnection con = new OracleConnection(connectionString))
{
    OracleCommand cmd = new OracleCommand();
    //some other code here
    con.Open();
}

I'm not using EF or so. I (de)serialze the data from the reader directly into a json or xml string.

I have a small batch file to test the api. The batch sends a request using curl every second and when I run the batch file 5 times, to simulate a little bit of traffic, (I know there are some tools for that, but thats not the problem) the api has open 7 connections to the database. Why are 7 db connections open, how to handle it, so that a maximum of 2 or 3 simultaneously are open, even if a request has to wait?

I do not want to "just make it work", I want it to work the right way. Because of that, I want to now, is "connection pooling" the keyword here? Especially the max pool size, could I just set it to 3, or did I forget something to set up, or something?

0

There are 0 best solutions below