views:

465

answers:

2

Hi Stackoverflow,

I am executing a simple query against SQL Server 2005:

protected static void InitConnection(IDbCommand cmd) {
        cmd.CommandText = "set transaction isolation level read uncommitted ";
        cmd.ExecuteNonQuery();            
    }

Whenever I profile with dotTrace 3.1, it claims that SNIReadSync method is taking between 100 - 500 ms.

What sort of things do I need to be looking for in order to get this time down?

Thanks!

A: 

Ensure that connection pooling is enabled or you will receive a significant penalty each time a connection is opened. In your connection string set Pooling=True, or remove any reference to pooling. I believe the default is enabled.

This fixed the issue for me. Hope it helps for you and others.

Matt
Yes, connection pooling is enabled. I took some profile traces using dotTrace in our peak on a server today...And SNIReadSync seems to be the biggest monster :)... Looks like implementing a distributed caching server could help this.
Mike
A: 

Hi, Did you get a solution to this issue? We are having a similar issue in our product. Thanks.

Aasia