T
T
TheCoreFactory2018-02-05 16:43:32
SQL Server
TheCoreFactory, 2018-02-05 16:43:32

MS SQL connection pool or MultipleActiveResultSets=True (MARS)?

MSSQL database in Azure.
In fact, one multi-threaded, console program to which 1000+ clients are connected works with the database. Only INSERT/SELECT is used. Up to 100 samples/peak entries can be made at one time. Now it's all implemented through a pool of 100 connections.
I tried to switch everything to one connection with MultipleActiveResultSets=True, I did not see any special changes in the test, and the implementation is more transparent.
Actually a question: where reefs at such decision?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Kuznetsov, 2018-02-05
@DarkRaven

If I remember correctly, with active MARS you work with the database synchronously (batch). And there everything is not about parallelism, but about the alternation of instructions, as it is written in the documentation. This fact would have alarmed me.
I advise you to pay attention to the documentation:
https://docs.microsoft.com/en-us/dotnet/framework/...
In general, in this situation pool connections are better than MARS, as it seems to me.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question