<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Performance Impact: Profiler Tracing vs. Server Side SQL Tracing</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.aspx</link><description>Adam Machanic asked me whether I had done any tests to compare the performance impact of using SQL Profiler on the client side and that of using SQL Trace on the server side. This is an interesting question because the frequently heard recommendation</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: Performance Impact: Profiler Tracing vs. Server Side SQL Tracing</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.aspx#2066</link><pubDate>Thu, 02 Aug 2007 11:24:11 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2066</guid><dc:creator>Greg Linwood</dc:creator><description>&lt;p&gt;Good article Linchi&lt;/p&gt;
&lt;p&gt;As you're aware already, I'm in the remote db admin business. Understanding the impact of SQLTrace is very important to my business because we need to keep traces running all the time if we are going to have any hope of answering customer questions about what was wrong with their servers in the past hour or so whenever they might call up complaining about performance. Obviously there's no point starting traces after the fact so we need them running all the time but we also don't want them impacting performance in the first place..&lt;/p&gt;
&lt;p&gt;So we have undertaken many similar tests over the past 4 years and have consistently come up with similar results. Server-side traces have almost no impact on overall server performance but interactive Profiler sessions can have a noticably bigger impact. However, I've never seen *such* a significant difference as with your results, but then again I never run unfiltered Profiler sessions on live systems so there might be a major difference there. Your testing only has the default &amp;quot;no profiler activity&amp;quot; filter but is otherwise collecting all events. Perhaps a more useful test would be to put a simple filter such as Reads &amp;gt; 200 on just to fish out the lionshare of relatively meaningless information which most people wouldn't collect?&lt;/p&gt;
&lt;p&gt;One very obvious problem with running SQL Profiler traces on the server which I don't think you mentioned is that it causes heavy CPU context switching if a lot of events are being captured (as the application's busy &amp;amp; taking CPU time away from SQL Server). Another interesting test would be to see how much difference occurred if you had SQL Server affinitised to 3 CPUs..&lt;/p&gt;
&lt;p&gt;I'd also like to point out that the systems we do our trace impact evaluation on are real systems - we always collect various Perfmon counters but sometimes turn off SQLTracing to compare results. All of the servers are different (different customers in different industries running different systems etc) but the SQL Trace impact differential is always fairly consistent even though the servers are all very different..&lt;/p&gt;
&lt;p&gt;One lesson we've learned is that there's a significant difference in overall server performance impact based on how many filters are configured for any given trace. Again, your trace only had the default filter which excludes Profiler events, but our tracing (&amp;amp; most routine tracing) always includes some sort of filter. We've found that too MANY filters (eg 7 or 8 on a single trace) can have a huge impact on server-side traces, even if only a few otherwise healthy events such as those in this trace are being collected. &lt;/p&gt;
&lt;p&gt;It would be interesting to see how adding more filters affected your results.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Greg Linwood&lt;/p&gt;
</description></item><item><title>re: Performance Impact: Profiler Tracing vs. Server Side SQL Tracing</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.aspx#2069</link><pubDate>Thu, 02 Aug 2007 13:57:06 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2069</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Greg,&lt;/p&gt;
&lt;p&gt;Just to clarify, when you say that Profiler causes context switching, you mean only if Profiler itself is run on the same server running SQL Server, i.e. from the console or a RD connection, right? &lt;/p&gt;
</description></item><item><title>re: Performance Impact: Profiler Tracing vs. Server Side SQL Tracing</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.aspx#2070</link><pubDate>Thu, 02 Aug 2007 14:02:58 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2070</guid><dc:creator>Greg Linwood</dc:creator><description>&lt;p&gt;Adam, Yes - the overhead can be substantial because it's not just about screen refreshes. There's a lot of overhead associated with re-structing event rows from their constituent column fragments. The more events, the more CPU workload the Profiler generates.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Greg Linwood&lt;/p&gt;
</description></item><item><title>re: Performance Impact: Profiler Tracing vs. Server Side SQL Tracing</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.aspx#13313</link><pubDate>Thu, 16 Apr 2009 02:54:27 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:13313</guid><dc:creator>Jose Mariano Alvarez</dc:creator><description>&lt;p&gt;Remember you can use server side traces with profiler if run locally in server.&lt;/p&gt;
</description></item><item><title>re: Performance Impact: Profiler Tracing vs. Server Side SQL Tracing</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.aspx#18495</link><pubDate>Tue, 03 Nov 2009 12:59:02 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:18495</guid><dc:creator>davetiye </dc:creator><description>&lt;p&gt;g&amp;#252;zel davetiye s&amp;#246;zleri ve davetiye modeloleri&lt;/p&gt;
</description></item><item><title>re: Performance Impact: Profiler Tracing vs. Server Side SQL Tracing</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.aspx#18496</link><pubDate>Tue, 03 Nov 2009 12:59:36 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:18496</guid><dc:creator>davetiye </dc:creator><description>&lt;p&gt;g&amp;#252;zel davetiye s&amp;#246;zleri ve davetiye modelleri&lt;/p&gt;
</description></item><item><title>re: Performance Impact: Profiler Tracing vs. Server Side SQL Tracing</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.aspx#18518</link><pubDate>Wed, 04 Nov 2009 07:48:22 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:18518</guid><dc:creator>davetiye</dc:creator><description>&lt;p&gt;g&amp;#252;zel davetiye s&amp;#246;zleri ve davetiye metinleri&lt;/p&gt;
</description></item><item><title>re: Performance Impact: Profiler Tracing vs. Server Side SQL Tracing</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.aspx#26353</link><pubDate>Tue, 22 Jun 2010 10:00:59 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:26353</guid><dc:creator>rich</dc:creator><description>&lt;p&gt;Pingback from &lt;a rel="nofollow" target="_new" href="http://sqlsolace.blogspot.com/2010/06/bookmark-performance-impact-of-profiler.html"&gt;http://sqlsolace.blogspot.com/2010/06/bookmark-performance-impact-of-profiler.html&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Performance Impact: Profiler Tracing vs. Server Side SQL Tracing</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.aspx#26357</link><pubDate>Tue, 22 Jun 2010 11:04:04 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:26357</guid><dc:creator>Mark Broadbent</dc:creator><description>&lt;p&gt;Good post Linchi.&lt;/p&gt;
&lt;p&gt;&amp;quot;the temporary files to buffer the profiler trace data were in directory C:\Documents and Settings\lshea\local settings\Temp\1, and the names of the temporary files had this pattern: Prf*.tmp.&amp;quot;&lt;/p&gt;
&lt;p&gt;..yes in fact the danger is (especially if on server) that you will fill out your C drive. You can minimize the risk somewhat when the GUI is absolutely necessary by creating a symbolic link to another less important drive for this temp directory. I've tried it in the past and it works fine.&lt;/p&gt;
&lt;p&gt;Mark Broadbent aka retracement&lt;/p&gt;
</description></item><item><title>re: Performance Impact: Profiler Tracing vs. Server Side SQL Tracing</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.aspx#30758</link><pubDate>Thu, 18 Nov 2010 23:40:25 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:30758</guid><dc:creator>Niraj Dube</dc:creator><description>&lt;p&gt;Very interesting thread, guys. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;To Greg’s comment that there is “no point starting traces after the fact”: There are tools in the market that allow you to monitor SQL queries on an “always on” basis -- without imposing any performance overhead on the server.&lt;/p&gt;
&lt;p&gt;Sort of &amp;quot;have your cake and eat it too&amp;quot;.&lt;/p&gt;
&lt;p&gt;Full disclosure: I work for one of the vendors who provide such tools. &amp;nbsp;Vendors use various mechanisms to ensure that their performance monitoring is non-intrusive. Ours does not open a connection to the db nor poll it in any way; instead, we listen to network traffic to passively capture queries and calculate associated performance metrics (such as server reaction time, query response time, round-trip time, etc); and we have a loopback module to capture local traffic. We specialize in high-transaction / high-volume production database monitoring – where, to quote a blogger I saw elsewhere, “you cannot have the odometer slow down the car”. &amp;nbsp;More about us at: &lt;a rel="nofollow" target="_new" href="http://www.exact-solutions.com/products/iwatch"&gt;http://www.exact-solutions.com/products/iwatch&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>A Brief History of Monitoring (A Month of Activity Monitoring, Part 1 of 30)</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.aspx#35056</link><pubDate>Wed, 20 Apr 2011 14:43:26 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:35056</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;This post is part 1 of a 30-part series about the Who is Active stored procedure. A new post will run&lt;/p&gt;
</description></item><item><title>re: Performance Impact: Profiler Tracing vs. Server Side SQL Tracing</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.aspx#38654</link><pubDate>Thu, 22 Sep 2011 15:13:11 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:38654</guid><dc:creator>Phil</dc:creator><description>&lt;p&gt;I have a problem with this article, which is that it states that the Default Trace was used for the test. &amp;nbsp;Now, who in reality actually uses the default trace? &amp;nbsp;That trace captures many events that are not only pretty useless, but which are unfilterable.&lt;/p&gt;
&lt;p&gt;If you run a profiler trace without sensible filtering, then of course you will see performance issues. &amp;nbsp;It's also perfectly possible to stuff up performance using a server side trace if you get it wrong, &amp;nbsp;and because the server side trace is guaranteed lossless (it will not discard events if they are generated faster than it can write them to the file - SQL will be forced to wait whilst the writes take place) then a SS trace can actually have a worse impact on your server than a profiler trace.&lt;/p&gt;
&lt;p&gt;I'd like to see these tests repeated using sensible, real-world filtering. &amp;nbsp;At my workplace we are absolutely paranoid about millisecond performance (we run in excess of 20,000 transactions per second on our main server, so we have to be!), &amp;nbsp;but we still run profiler traces throughout the day with no performance impact. &amp;nbsp;That's because we put sensible filters on the traces.&lt;/p&gt;
&lt;p&gt;Profiler CAN impact performance, it's true, but so can server-side traces. &amp;nbsp;It's up to the DBA to implement both types sensibly, but don't be afraid to use either one. &amp;nbsp;They each have their merits.&lt;/p&gt;
</description></item><item><title>Avoid Causing Problems with Profiler | Dan Guzman&amp;#039;s Blog</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2007/08/01/trace-profiler-test.aspx#48910</link><pubDate>Mon, 29 Apr 2013 01:23:20 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:48910</guid><dc:creator>Avoid Causing Problems with Profiler | Dan Guzman's Blog</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.dbdelta.com/avoid-causing-problems-with-profiler/"&gt;http://www.dbdelta.com/avoid-causing-problems-with-profiler/&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>