7
votes

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?

1
I just saw that and it doesn't make sense at all. By default Pooling and MARS are disabled.Christian Rodriguez
I will have the Azure Portal updated. The default and recommended value for Pooling is "true"; however, the default and recommended value for MARS is "false".andrea-lam-MSFT

1 Answers

1
votes

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.