Relation between different kinds of pools in ASP.NET application

Viewed 119

There are different kinds of pools in scope of ASP.NET (EF Core) app development, at least I currently consider four:

  • DbContext Pool
  • DbConnection Pool
  • Worker thread Pool
  • IOCP thread Pool

I'm just trying to complain some diagram of their relation in my head for finding an optimal size constraints for corresponding pools.

The most interesting thing here is about bottleneck situations, like cases when there are lots of available free entities in one pool at the moment, while another pool is being completely exhausted (it's obvious for Worker/IOCP pools interaction - e.g. when I do await Task.WaitAll(/*numerous hard-drive I/O tasks*/), but absolutely not obvious for DbContext/DbConnection pools).

My assumption here is that each DbContext is bound to some concrete Worker Thread, and just controls EF entities on an in-memory level, whereas IOCP Threads just depend on DbConnections (speaking just of interaction btw the App and the DataBase) - which is to say that DbConnection and DbContext loads are 1:1 for simple applications.

But something suggests my assumption is wrong and the relation is pretty much more complex, and involves all [at least] four kinds of pools, which leads into the question "what pool constraints should be defined at-first as a hyperparameter, so all the rest constraints of other pools could be somehow dependent and defined according to the former".

0 Answers
Related