<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.iis.net/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/" xmlns:cs="http://blogs.iis.net/"><channel><title>Dave&amp;#39;s Blog : Perf Counters</title><link>http://blogs.iis.net/davcox/archive/tags/Perf+Counters/default.aspx</link><description>Tags: Perf Counters</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Perf counter behavior changes in IIS6</title><link>http://blogs.iis.net/davcox/archive/2006/03/17/perf-counter-behavior-changes-in-iis6.aspx</link><pubDate>Fri, 17 Mar 2006 21:41:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1288444</guid><dc:creator>alowe</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/davcox/rsscomments.aspx?PostID=1288444</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/davcox/commentapi.aspx?PostID=1288444</wfw:comment><comments>http://blogs.iis.net/davcox/archive/2006/03/17/perf-counter-behavior-changes-in-iis6.aspx#comments</comments><description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;I thought I'd really just share some information I collected while testing perf counters during the IIS6 days.&amp;nbsp; The big changes were primarily to address the architecture and new process model that HTTP.sys and IIS provided and also to help our scalability situation.&amp;nbsp; Much of the counter behavior was already&amp;nbsp;documented in the resource kit, but I thought I'd add my own flavor to this, since I helped the UE people write the docs and I think they did a great job given the difficult challenge it is to write about something as you learn it.&amp;nbsp; So this blog basically covers two items; it covers counters that have new behavior and then some registry keys you can set if you really need to scale out your server for tens of thousands of sites (rare).&amp;nbsp; &lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial; TEXT-DECORATION: underline"&gt;Counters that have updated behavior&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;Bytes Per Second and Total Bytes counters&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;In IIS5, these counters gave you the Bytes per Second:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; "BYTES_SENT_COUNTER",&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; "BYTES_RECEIVED_COUNTER",&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; "BYTES_TOTAL_COUNTER"&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;In IIS6, they give you Bytes Total (Total sent, total received, total sent+received)&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;These counters are new in IIS6 and will return the Bytes per Second values:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "BYTES_SENT_PER_SEC",&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "BYTES_RECEIVED_PER_SEC",&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "BYTES_TOTAL_PER_SEC"&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;This brings the PDH counters in line with SNMP counters that had already existed.&amp;nbsp; &lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;IIS 6.0 counts Current Non/AnonymousUsers as Current Requests; IIS5 equates users with connections.&amp;nbsp; &lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;This means that you’re going to notice much smaller CurrentAnonymousUsers count in IIS6 (and consequently a lower MaxAnonymousUser). The same is true for NonAnonymousUser counters.&amp;nbsp; But actually it is just more accurate.&amp;nbsp; CurrentUsers are now the # of current in-flight requests (the # of requests currently being worked on by the server).&amp;nbsp; CurrentConnections is a better counter to monitor for scalabilty and availability metrics (its behavior is unchanged).&amp;nbsp; This number will of course be much higher than the number of users for sites that support keep-alive connections.&amp;nbsp; &lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;It’s important to remember that in IIS6 each request (not connection) is logically a user.&amp;nbsp; &lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;In IIS 6.0 the Kernel Mode Cache causes some new behavior in counters.&amp;nbsp; &lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;You may notice that these counters no longer increment when files are only being served out of the Kernel-Mode cache.&amp;nbsp; &lt;/P&gt;
&lt;P style="FONT-SIZE: 9pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Total Files Sent&lt;/P&gt;
&lt;P style="FONT-SIZE: 9pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Total Files Transfered&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;Instead, Web Service Cache\Kernel: URI Cache Hits will be incremented. &amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 9pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;Total Anonymous Users and related Anonymous User counters will be updated during cache hits.&amp;nbsp; Be aware that the Kernel mode cache does not cache requests that are authenticated so the NonAnonymousUser related counters are exactly the same as before.&amp;nbsp; &lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial; TEXT-DECORATION: underline"&gt;New general counter behavior&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;Several new registry keys exist to help IIS scale to many more sites: &lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;The registry keys all exist under this node:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Arial"&gt;HKLM\SYSTEM\CurrentControlSet\Services\w3svc\Performance\&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.5in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;Here are some typical settings that we used in our testing (no warranties expressed or implied):&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;"FreshTimeForCounters",1,"REG_DWORD"&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;"CheckCountersEveryNMiliseconds",250,"REG_DWORD"&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;"NumberOfTimesToCheckCounters",8,"REG_DWORD"&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Arial"&gt;These registry keys&amp;nbsp;allows IIS to “check” on the counters less often.&amp;nbsp; As you add more sites to IIS, each site will be “asked” for counters which can be quite time consuming.&amp;nbsp; The idea here is that you want to increase the Miliseconds and FreshTime&amp;nbsp;to a higher number when you have higher sites.&amp;nbsp; You'll know you might want to do this if you have a lot of extremely idle sites (on the order of more than 10 thousand), but the w3wp's are using up a lot of processor time.&amp;nbsp; Be careful here, most people won't need to mess with these registry keys.&amp;nbsp; &lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1288444" width="1" height="1"&gt;</description><category domain="http://blogs.iis.net/davcox/archive/tags/Perf+Counters/default.aspx">Perf Counters</category><category domain="http://blogs.iis.net/davcox/archive/tags/IIS6/default.aspx">IIS6</category></item></channel></rss>