programming4us
programming4us
WEBSITE

IIS 7.0 : Performance and Tuning - Network

- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire
2/27/2011 10:37:18 AM
One of the best performance enhancements in Microsoft Windows Server 2008 is a complete redesign of the Transmission Control Protocol/Internet Protocol (TCP/IP) stack, also known as the Next Generation TCP/IP stack. The TCP/IP stack has been redesigned to enable high-speed multi-gigabit capabilities without consuming all of the CPU power and resources on the server. It integrates security products into the Windows platform and makes it more manageable. In addition, the TCP/IP stack has been redesigned to make it more easily serviced, to add capabilities, and to let third-party independent software vendors (ISVs) add capabilities to it (specifically in the firewall and antivirus categories).

What Causes Network Pressure?

In a perfect world, bandwidth restrictions would not be an issue. Switched networks as well as 1 GB and greater network speeds have helped, but network utilization still can be a bottleneck. How you deal with it can make your applications successful or not. The increasing availability of high-speed networks and broadband connections does not guarantee a low latency experience.

High demand for content such as video streaming or audio files can lead to pressure on the network. The Internet is one big wide area network, and it takes only one slow connection to become saturated and cause packet loss. When packet loss occurs, higher latency and slower response times for applications can occur. Low latency and slow application response are less likely in a local area network. However, the network is only as strong as the weakest link.

Network Counters to Monitor

See Table 1 for a list of common network counters used to identify network-related issues on your IIS 7.0 server.

Table 1. Network Counters to Measure
Counter NameDescription
Network Interface(NICNAME)\Bytes Total/secThe rate at which bytes are sent and received over each network adapter, including framing characters. Network Interface\Bytes Total/sec is a sum of Network Interface\Bytes Received/sec and Network Interface\Bytes Sent/sec.
Network Interface(NICNAME)\Current BandwidthAn estimate of the current bandwidth of the network interface in bits per second (BPS). For interfaces that do not vary in bandwidth or for those where no accurate estimation can be made, this value is the nominal bandwidth.

Impact of Constraints

Dealing with slow router points or switches that are saturated can constrain how you provide services and keep the network functional. Using QoS (Quality of Service) and scheduling network-intensive operations during off-hours can help the impact on your network.

Having tools in place to monitor your network can help you spot trends and understand if your network is operating efficiently. The Next Generation TCP/IP stack supports the IETF draft RFC 4898, “TCP Extended Statistics MIB,” which defines extended performance statistics for TCP. By analyzing ESTATS on a connection, you can determine whether a connection’s performance is based on the sending application, the receiving application, or the network. ESTATS is disabled by default and can be enabled per connection. With ESTATS, non-Microsoft independent software vendor (ISVs) can create powerful diagnostics and network throughput analysis applications. Tcpanalyzer.exe, which is available in the Windows Vista SDK, is a diagnostic tool based on ESTATS.

The Explicit Congestion Notification (ECN) feature also enhances performance. When a TCP segment is lost, TCP assumes that the segment was lost due to congestion at a router, and it performs congestion control, dramatically lowering the TCP sender’s transmission rate. With ECN support on both TCP peers and in the routing infrastructure, a router experiencing congestion mark packets as it forwards them. TCP peers receiving marked packets lower their transmission rate to ease congestion and prevent segment losses. Detecting congestion before packet losses are incurred increases the overall throughput between TCP peers. ECN is not enabled by default. To enable ECN, run this command: netsh interface tcp set global ecncapability=enabled.

Countermeasures

How do you know what your network utilization is? Right-click in the Start Bar, select Task Manager, and navigate to the Networking tab. Select the network interface you would like to view and check its network utilization statistics. If your primary network card is close to 100 percent, the card is likely a bottleneck in the performance of your application. Generally, you should start to investigate if network utilization is around 50 percent. Figure 17-3 shows how Task Manager presents network utilization statistics.

Figure 1. Network utilization in Windows Task Manager.

The Next Generation TCP/IP stack is a complete redesign of TCP/IP functionality for both IPv4 and IPv6 that meets the connectivity and performance needs of today’s varied networking environments and technologies. The following features are new or enhanced:

  • Receive Window Auto-Tuning

  • Compound TCP

  • Enhancements for high-loss environments

  • Neighbor Unreachability Detection for IPv4

  • Dead Gateway Detection

  • Path Maximum Transmission Unit (PMTU) Black Hole Router Detection

  • Routing Compartments

  • Network Diagnostics Framework Support

  • Windows Filtering Platform

  • Explicit Congestion Notification

With its many new features and enhancements, Windows Server 2008 should help keep network pressure at a minimum. For more information, see the article posted on TechNet called “New Networking Features in Windows Server 2008 and Windows Vista” at http://technet.microsoft.com/en-us/library/bb726965.aspx.


Application-Level Counters

Microsoft provides several key application-level counters that can be useful in troubleshooting your application. Table 2 presents a subset of counters that can help troubleshoot ASP.NET and Web-related issues.

Table 2. Application Counters
Counter NameDescription
.NET CLR Exceptions(w3wp)\# of Exceps Thrown / secThe number of exceptions thrown per second. These include both .NET exceptions and unmanaged exceptions that get converted into .NET exceptions (e.g., a null pointer reference exception in unmanaged code would get rethrown in managed code as a .NET System.NullReference-Exception). This counter includes both handled and unhandled exceptions. Exceptions should only occur in rare situations and not in the normal control flow of the program; this counter was designed as an indicator of potential performance problems due to large (>100s) rate of exceptions thrown. This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.
.NET CLR Jit(w3wp)\% Time in JitThe percentage of elapsed time spent in JIT compilation since the last JIT compilation phase. This counter is updated at the end of every JIT compilation phase. A JIT compilation phase is the phase when a method and its dependencies are being compiled.
.NET CLR Jit(w3wp)\IL Bytes Jitted / secThe total IL bytes jitted since the start of the application. This counter is exactly equivalent to the “Total # of IL Bytes Jitted” counter.
.NET CLR Loading(w3wp)\% Time Loading 
.NET CLR Loading(w3wp)\Current appdomainsThe current number of AppDomains loaded in this application. AppDomains (application domains) provide a secure and versatile unit of processing that the CLR can use to provide isolation between applications running in the same process.
.NET CLR Loading(w3wp)\Current AssembliesThe current number of Assemblies loaded across all AppDomains in this application. If the Assembly is loaded as domain-neutral from multiple AppDomains, then this counter is incremented once only. Assemblies can be loaded as domain-neutral when their code can be shared by all AppDomains, or they can be loaded as domain-specific when their code is private to the AppDomain.
.NET CLR LocksAndThreads(w3wp)\Queue Length/secThe total number of times threads in the CLR have attempted to acquire a managed lock unsuccessfully. Managed locks can be acquired in many ways—by the “lock” statement in C#, or by calling System.Monitor.Enter, or by using MethodImplOptions.Synchronized custom attribute.
.NET CLR LocksAndThreads(w3wp)\Total # of ContentionsThe total number of times threads in the CLR have attempted to acquire a managed lock unsuccessfully. Managed locks can be acquired in many ways—by the “lock” statement in C#, or by calling System.Monitor.Enter, or by using MethodImplOptions.Synchronized custom attribute.
.NET CLR Memory(w3wp)\% Time in GCThe percentage of elapsed time that was spent in performing a garbage collection (GC) since the last GC cycle. This counter is usually an indicator of the work done by the Garbage Collector on behalf of the application to collect and compact memory. This counter is updated only at the end of every GC, and the counter value reflects the last observed value; it is not an average.
.NET CLR Memory(w3wp)\# Total Committed BytesThe amount of virtual memory (in bytes) currently committed by the Garbage Collector. (Committed memory is the physical memory for which space has been reserved on the disk paging file.)
.NET CLR Memory(w3wp)\# Bytes in all HeapsThe sum of four other counters—Gen 0 Heap Size, Gen 1 Heap Size, Gen 2 Heap Size, and the Large Object Heap Size. This counter indicates the current memory allocated in bytes on the GC Heaps.
.NET CLR Memory(w3wp)\# Gen 0 CollectionsThe number of times the generation 0 objects (youngest; most recently allocated) are garbage collected (Gen 0 GC) since the start of the application. Gen 0 GC occurs when the available memory in generation 0 is not sufficient to satisfy an allocation request. This counter is incremented at the end of a Gen 0 GC. Higher generation GCs include all lower generation GCs. This counter is explicitly incremented when a higher generation (Gen 1 or Gen 2) GC occurs. _Global_ counter value is not accurate and should be ignored. This counter displays the last observed value.
.NET CLR Memory(w3wp)\# Gen 1 CollectionsThe number of times the generation 1 objects are garbage collected since the start of the application. The counter is incremented at the end of a Gen 1 GC. Higher generation GCs include all lower generation GCs. This counter is explicitly incremented when a higher generation (Gen 2) GC occurs. _Global_ counter value is not accurate and should be ignored. This counter displays the last observed value.
.NET CLR Memory(w3wp)\# Gen 2 CollectionsThe number of times the generation 2 objects (older) are garbage collected since the start of the application. The counter is incremented at the end of a Gen 2 GC (also called full GC). _Global_ counter value is not accurate and should be ignored. This counter displays the last observed value.
.NET CLR Memory(w3wp)\# Induced GCThe peak number of times a garbage collection was performed because of an explicit call to GC.Collect. It’s a good practice to let the GC tune the frequency of its collections.
.NET CLR Memory(w3wp)\Allocated Bytes/secThe rate of bytes per second allocated on the GC Heap. This counter is updated at the end of every GC, not at each allocation. This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.
.NET CLR Memory(w3wp)\Finalization SurvivorsThe number of garbage collected objects that survive a collection because they are waiting to be finalized. If these objects hold references to other objects, then those objects also survive but are not counted by this counter; the “Promoted Finalization-Memory from Gen 0” and “Promoted Finalization-Memory from Gen 1” counters represent all the memory that survived due to finalization. This counter is not a cumulative counter; it’s updated at the end of every GC with count of the survivors during that particular GC only. This counter was designed to indicate the extra overhead that the application might incur because of finalization.
.NET CLR Memory(w3wp)\Gen 0 Heap SizeThe maximum bytes that can be allocated in generation 0 (Gen 0); it does not indicate the current number of bytes allocated in Gen 0. A Gen 0 GC is triggered when the allocations since the last GC exceed this size. The Gen 0 size is tuned by the Garbage Collector and can change during the execution of the application. At the end of a Gen 0 collection, the size of the Gen 0 heap is in fact 0 bytes; this counter displays the size (in bytes) of allocations that would trigger the next Gen 0 GC. This counter is updated at the end of a GC; it’s not updated on every allocation.
.NET CLR Memory(w3wp)\Gen 1 Heap SizeThe current number of bytes in generation 1 (Gen 1); this counter does not display the maximum size of Gen 1. Objects are not directly allocated in this generation; they are promoted from previous Gen 0 GCs. This counter is updated at the end of a GC; it’s not updated on every allocation.
.NET CLR Memory(w3wp)\Gen 2 Heap SizeThe current number of bytes in generation 1 (Gen 1); this counter does not display the maximum size of Gen 1. Objects are not directly allocated in this generation; they are promoted from previous Gen 0 GCs. This counter is updated at the end of a GC; it’s not updated on every allocation.
.NET CLR Memory(w3wp)\Large Object Heap SizeThe current size of the Large Object Heap in bytes. Objects greater than 20 kilobytes (KB) are treated as large objects by the Garbage Collector and are directly allocated in a special heap; they are not promoted through the generations. This counter is updated at the end of a GC; it’s not updated on every allocation.
.NET CLR Memory(w3wp)\Process IDThe process ID of the CLR process instance being monitored.
.NET CLR Security(w3wp)\% Time in RT checksThe percentage of elapsed time spent in performing run-time Code Access Security (CAS) checks since the last such check. CAS allows code to be trusted to varying degrees and enforces these varying levels of trust depending on code identity. This counter is updated at the end of a run-time security check. It represents the last observed value; it’s not an average.
ASP.NET Applications(__Total__)\Cache Total TrimsTotal number of entries forcibly removed from the cache due to memory pressure.
ASP.NET Applications(__Total__)\Cache Total EntriesTotal number of entries within the cache (both internal and user added)
ASP.NET Applications(__Total__)\Cache Total Hit RatioRatio of hits from all cache calls.
ASP.NET Applications(__Total__)\Cache Total Turnover RateNumber of additions and removals to the total cache per second.
ASP.NET Applications(__Total__)\Output Cache EntriesCurrent number of entries in the output cache.
ASP.NET Applications(__Total__)\Output Cache HitsTotal number of output cacheable requests served from the output cache.
ASP.NET Applications(__Total__)\Output Cache Hit RatioRatio of hits to requests for output cacheable requests.
ASP.NET Applications(__Total__)\Output Cache Turnover RateNumber of additions and removals to the output cache per second.
ASP.NET Applications(__Total__)\Compilations TotalNumber of .asax, .ascx, .ashx, .asmx, or .aspx source files dynamically compiled.
ASP.NET Applications(__Total__)\Errors Total/SecRate of errors occurred.
ASP.NET Applications(__Total__)\Pipeline Instance CountNumber of active pipeline instances.
ASP.NET Applications(__Total__)\Requests ExecutingThe number of requests currently executing.
ASP.NET Applications(__Total__)\Requests in Application QueueThe number of requests in the application request queue.
ASP.NET Applications(__Total__)\Requests/SecThe number of requests executed per second.
ASP.NET\Application RestartsNumber of times the application has been restarted during the Web server’s lifetime.
ASP.NET\Request Wait TimeThe number of milliseconds the most recent request was waiting in the queue.
ASP.NET\Requests CurrentThe current number of requests, including those that are queued, currently executing, or waiting to be written to the client. Under the ASP.NET process model, when this counter exceeds the requestQueueLimit defined in the processModel configuration section, ASP.NET will begin rejecting requests.
ASP.NET\Requests QueuedThe number of requests waiting to be processed.
ASP.NET\Requests RejectedThe number of requests rejected because the request queue was full.
Web Service(_Total)\Get Requests/secThe rate at which HTTP requests using the GET method are made. GET requests are the most common HTTP request.
Web Service(_Total)\Post Requests/secThe rate at which HTTP requests using the POST method are made.
Web Service(_Total)\Connection Attempts/secThe rate that connections to the Web service are being attempted.
Web Service(_Total)\Current ConnectionsCurrent Connections is the current number of connections established with the Web service.
Web Service(_Total)\ISAPI Extension Requests/secThe rate at which ISAPI Extension requests are received by the Web service.
Web Service\Service UptimeThe length of time the Web Service has been running.
Web Service\Total Method RequestsThe number of all HTTP requests (since service startup).
Web Service Cache\URI Cache Hits %The ratio of user-mode URI Cache Hits to total cache requests (since service startup).
Other  
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
REVIEW
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
Video Sports
programming4us programming4us
programming4us
 
 
programming4us