Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why default Azure database connection string has Pooling=False

I copied the connection string from Azure Database as below:

enter image description here

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?

like image 268
cuongle Avatar asked Jun 08 '16 23:06

cuongle


People also ask

Is connection pooling enabled by default?

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.

What is pooling false in connection string?

Google Connection-Pooling, false means that you are not using it.

What is pooling true in connection string?

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.

Is connection pooling necessary?

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.


1 Answers

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.

like image 101
Bryan Roberts Avatar answered Oct 20 '22 00:10

Bryan Roberts