I copied the connection string from Azure Database as below:
And I see by default, Azure database connection string has Pooling=False
Server=tcp:{your_server}.database.windows.net,1433;Data Source=ra-labs-01.database.windows.net;Initial Catalog={your_database};Persist Security Info=False;User ID={your_username};Password={your_password};Pooling=False;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
That makes me a little confused since my current understanding is Pooling=False
is not recommended.
So by default, connection string to Azure disables connection pooling, or because I has put my database into Elastic pool?
By default, connection pooling is enabled in ADO.NET. Unless you explicitly disable it, the pooler optimizes the connections as they are opened and closed in your application. You can also supply several connection string modifiers to control connection pooling behavior.
Google Connection-Pooling, false means that you are not using it.
Connection pooling reuses existing active connections with the same connection string instead of creating new connections when a request is made to the database. It involves the use of a connection manager that is responsible for maintaining a list, or pool, of available connections for a given connection string.
Using connection pools helps to both alleviate connection management overhead and decrease development tasks for data access. Each time an application attempts to access a backend store (such as a database), it requires resources to create, maintain, and release a connection to that datastore.
Azure SQL does support connection pools in both the standard DB's and the elastic pools. I think if you were seeing this then it was likely not intended as none of my accounts are showing this setting on by default. You can see guidelines for azure connections on the main website. As opposed to an onsite server you may suffer from more closed connections due to the latency and nature of the public internet however this is mitigated with transient fault handling in later versions of ado.net and other connection frameworks. This technology allows for retrying of connections that were dropped or interrupted without the program having to respond directly. Programs that manage connections efficiently may see some improvement with connection pooling.
In regards to MARS (Multiple Active Result Sets) this is a very chatty protocol and while you could turn this on it will affect latency and response time. It is not recommended to use this with Azure SQL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With