FYI, I'm blogging most of my stuff over at More Wally now.
You might want to add my rss feed to your reader at:http://morewally.com/cs/blogs/wallym/rss.aspx
MARS should be turned off in your Connection String with Sql Server 2005 - Wallace B. McClure

Wallace B. McClure

All About Wally McClure - The musings of Wallym on .NET, Sql, ASP.NET, and other crazy shenanigans

News

Personal Blog

Work Blog

.NET

Book Authors

Business

Family

Friends

Georgia Tech Bloggers

Personal

MARS should be turned off in your Connection String with Sql Server 2005

I've been doing a small amount of testing with the June CTP of Sql Server 2005 and ADO.NET V2.  MARS is turned on by default in a SqlConnection.  I would suggest turning MARS off, unless you need it.  I am seeing a performance difference between having MARS turned on and off, just on regular ADO.NET commands.

You can use the SqlConnectionStringBuilder object and set .MultipleActiveResultSets = False

Wally

Update: Ok, how dumb was this.  I misread my own code.  I was explicitly turning MARS on and off while doing the performance test.  I thought I was only turning this off.  I feel so stupid.

Comments

Hannes Preishuber said:

you should say what performance diffrence you see. You blog entry shows nothing( sorry)
is it faster or slower, how much and in which scenario.
I belive this is important. I can hear the future suggestions "turn off mars" and nobody knows why.
# June 19, 2005 4:50 AM

Wallym said:

Due to the the product being beta and the fact that the license disallows the quoting of performance numbers, I can't quote numbers. I've also been told that the performance problem I have seen is minimized between now and rtm. However, MARS is still an extra service that most applications do not need. Support for it will provide some type of overhead. If you don't need it, don't use it.

Wally
# June 19, 2005 8:38 AM

Sahil Malik said:

Wow, this has reversed in beta2 - it used to be that you had to turn MARS "on" using the connection string. Any ideas why the reversal?
# June 20, 2005 2:31 AM

Angel said:

This is probably old news by now, but we have officially decided to turn MARS off by default for RTM based on customer feedback.

Personally I am very glad that this is now an "opt in" property.
# June 20, 2005 11:48 AM

Wallym said:

Angel,

Thanks for the news. I was not aware of that.

Wally
# June 20, 2005 12:04 PM

Sahil Malik said:

Okay so MARS is off by default - i.e. no change. WOOHOO :)
# June 20, 2005 6:34 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)