Chapter 5. Application Network Analysis

The approach to performing an application network analysis of Web-based applications remains unchanged between operating systems (Microsoft Windows NT, Windows 2000, and Windows XP), development technologies (static HTML, ASP, Windows DNA, and now .NET), and data access technologies (RDO, ADO and ADO.NET). This process has remained consistent because the primary protocol used to communicate over the Internet (TCP/IP) has not changed. With the advent of .NET and software as a service, this approach can be used to identify network-related bottlenecks and improve the network performance of both legacy applications and those built with the .NET Framework.

Conducting an Application Network Analysis

Many Internet users still use modems that connect at painfully slow speeds, and they probably will for the foreseeable future. The goal of an application network analysis is to identify slowly executing pages or code and fix them to provide a better end user experience. We assume that you are familiar with networking basics, such as the Open Systems Interconnection (OSI) model, but do not expect you to be as familiar with conducting a network analysis. Therefore, before we delve into the process of conducting a network analysis, it’s imperative that you become familiar with the concepts and terminology behind the application network analysis process. If there are terms discussed in this chapter that are unfamiliar to you, please refer to the Microsoft Encyclopedia of Networking, Second Edition written by Mitch Tullock (Microsoft Press, 2002). You should also become familiar with the type of questions you’ll be facing from the customer’s perspective. For example, questions you’ll hear from application owners may include: How does network latency impact my global users? What is a network round trip and how does it affect my end user experience? How do I determine the amount of data transferred for each page view and other content loaded when my customers access my Web application? My users are complaining of long response times. What can I do? How do I identify and avoid processing delays on my IIS server or SQL server?

As we progress through the chapter, we will answer questions such as these. We will define these terms and provide examples that will help illustrate these concepts and their effect on application performance. Also, we will provide an introduction to tools used to perform an application network analysis: Microsoft Network Monitor, and Compuware’s Application Expert.

Note

We use the term page view to refer to the actual page plus elements or file types associated with it. For example, the Default.aspx will include this file and any image files, style sheets, java scripts, etc. that accompany it.

Network Latency

The simplest definition of network latency is the time it takes for a data packet to move across a network connection. The lower the latency between your Web application tiers, the faster the response times. Latency and bandwidth are two factors that determine the speed of a network connection. An easy way to determine the network latency between your client and a Web application is to use the pathping utility, or other utilities such as the Visual Trace Route feature provided in Application Expert. A PowerPoint presentation of Compuware’s Application Expert can be found on this book’s companion CD.

Note

The pathping utility is a command-line tool that combines features of the ping and tracert commands. To use, open a command prompt and type pathping servername. The output from the pathping command will show you the hops or network routers between the client you are using and the server you are pinging, along with the latency or round trip time for the particular hop.

Every local area network (LAN) and wide area network (WAN) connection is constrained by network latency. Factors that cause latency to increase are poor quality network devices, longer distances causing communication travel through more hops or network devices, and network congestion. For example, a typical 56-kbps local modem connection may have 200 milliseconds of latency, while a similar connection traveling a farther distance may pass through more network devices, which increases the latency to 500 milliseconds. In Table 5-1, we captured a trace with Network Monitor to measure the impact of network latency when requesting the 46-kilobyte home page of IBuySpy with our Microsoft Internet Explorer Web browser. The capture was imported into Application Expert’s Response Time Predictor, and we are able to extrapolate the response times for both a 200-millisecond and 500-millisecond latency 56-kbps connection. We’ll discuss this Application Expert feature and others in the “Using Compuware Application Expert” section later in this chapter.

Table 5-1. Latency and Response Time

Connection Speed

Latency

Response Time

10 mbps

10 milliseconds

0.5 seconds

56 kbps

200 milliseconds

6 seconds

56 kbps

500 milliseconds

8.5 seconds

The impact of the additional 300 milliseconds of latency for this particular page view and all associated elements is 2.5 seconds, not 300 milliseconds. The reason for this is latency affects every application round trip.

Note

One way to deal with the impact of latency is to locate your Web application closer geographically to your user base. This does not guarantee a better connection between your user base and Web application but will typically reduce the amount of latency.

Network Round Trips

A network round trip is a client-server request-response pair generated by an application. A request-response pair sent from a Web browser to a Web server and back is considered a single round trip. For example, when you type in a URL in your Web browser, such as http://www.microsoft.com, each image, style sheet, or other page element defined in the response to your request (from the Web server) is counted as a separate network round trip. Additional round trips are involved in the setup of each connection to the Web server in this example. Later in this chapter we will discuss how Application Expert can be used to quickly obtain the number of round trips your ASP pages are consuming. Combined with latency, round trips have a profound effect on application response time. Imagine that your IIS servers are located on both the US East and West Coasts. You are located in Mountain View California and viewing your IBuySpy Login ASPX page on the West Coast IIS server takes 4 seconds while viewing it from the East Coast IIS server takes 6.5 seconds. Further investigation shows the latency for your connection to the East Coast server is 500 milliseconds while that to the West Coast server is 200 milliseconds. Because every round trip is affected by network latency, the East Coast response time is longer by approximately 2 seconds.

For most application developers, network latency on the Internet is out of their control. This is why it is important to develop applications that use as few round trips as possible to keep response times quick even under high network latency conditions.

Reducing Network Round Trips

The most effective method for reducing round trips is to reduce the number of objects per page. Table 5-2 shows two home pages for major Internet search sites that many of you have probably used before. The first home page has fewer than six objects and loads very quickly. The second home page has approximately 15 objects and loads much more slowly. Notice the difference in the number of round trips that are generated when each of these home pages are loaded.

Table 5-2. How Objects per Page Affect Round Trips

Sites

Number of Objects

Number of Round Trips

Search Site 1 (Optimized)

6

8

Search Site 2 (Slow)

15

19

Search Site 1 used in Table 5-2 was able to limit the number of objects to six and has a less than 10-second response time on most 56-kbps connections. They limit the number of objects to six by creating one large graphic at the top of their home page, which consists of eight images. Considering each object requested will create a network round trip, they have saved seven round trips by merging their eight small graphics into a single request.

Data Transferred

Data transferred is the amount of data moved between a client Web browser and Web server and is often measured in kilobytes. The best approach for measuring data transferred is to break down the scenarios within your application by page views including their associated elements. For example, the IBuySpy home page transfers 46 kilobytes of data non-cached the first time you access it and 24 kilobytes of data cached (subsequent requests with many objects loaded from your Web browser cache located in the temporary Internet folder). Based on our experience, the amount of data transferred for a page view and associated elements of 50 kilobytes or less will give an acceptable response time. This allows low speed Internet connections like 56-kbps modems the best chance of having fast response times. This chapter uses several terms to quantify data, such as kilobits per second and kilobytes of data transferred. Therefore to better illustrate how these metrics relate, Table 5-3 shows the conversion from bits to bytes, kilobits to kilobytes, and kilobytes to megabytes.

Table 5-3. Conversion Metrics

Measured Value

Converted Value

8 bits

1 byte

1 kilobyte

1024 bytes

1024 kilobytes

1 megabyte

Reducing the Quantity of Data Transferred

There are several techniques for reducing the amount of data being transferred between Internet Explorer and the IIS tier. These methods include IIS compression, removing unnecessary characters and white space, reducing the number of objects on pages, and optimizing images.

HTTP Compression is a built-in feature of IIS and Internet Explorer. This tool works well for static content like HTM files, HTML files, CSS files, JS files, and uncompressed images. However, with dynamic content you may run into some problems, such as pages rendering incorrectly or becoming non-functional. There is also additional overhead associated with resources on your IIS server if you choose to use IIS compression. By default, HTTP Compression is disabled and can be enabled using the WWW Service Master Properties Services tab, shown in Figure 5-1.

Enabling IIS compression
Figure 5-1. Enabling IIS compression

Once HTTP Compression is enabled, you must specify the file types to be compressed by editing the metabase. The following steps show how to edit the metabase settings to compress static TXT, JS, CSS, DOC, and XLS files:

  1. Enable HTTP Compression as shown in Figure 5-1.

  2. Open a command prompt and navigate to the adminscripts folder.

  3. Execute the following command: cscript.exe adsutil.vbs set W3Svc/Filters/Compression/GZIP/HcFileExtensions “txt” “js” “css” “doc” “xls”

  4. Execute the following command: cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/HcFileExtensions “txt” “js” “css” “doc” “xls”

  5. Execute the following command: iisreset.exe /restart

Another method to trim down the amount of data transferred between the browser and IIS tier is to package the data more tightly by removing all unnecessary characters and white space from your code. This is particularly useful around loops when a lot of data is returned to the client. Also, many developers put comments into their code, which adds additional characters and lines to the page, resulting in more data transferred.

Note

If you are very conscious about reducing your page size as much as possible, use short variable and filenames as well as a flat directory structure. This will slightly reduce the amount of data transferred because you are passing less text to the client.

Reducing the number of objects on your page will decrease the amount of data transferred. Many sites use images for bullets and text instead of using formatted text. By limiting the number of elements and using colored text and background colors to make sections of the page stand out, you can reduce the amount of data transferred and network round trips.

Images make a Web site or application more visually appealing but there is a significant performance cost associated with using them. Use Graphics Interchange Format (GIF) images whenever possible. Using optimized or compressed images will reduce the amount of data transferred and typically does not impact the clarity of your pictures much. Most high quality imaging software suites will include a tool to optimize and compress your image files. Reuse images for your company logo, navigational bars or other images that are used throughout your application. Make sure you use the exact same name and path or Internet Explorer will treat it as a new image. After the initial fulfillment of the request Internet Explorer will cache the images locally. Another option is to preload images using JavaScript. This will load the images in the background while the rest of the page loads. Subsequent requests for the cached image will appear more quickly to the end user because the images will be cached locally in Internet Explorer.

Note

Make sure you set the height and width attributes of each image. It will load faster because the Internet Explorer client does not have to determine the dimensions.

Processing Delay

When client requests spend unnecessary time on the middle or back-end tier of an application, it is considered a processing delay. This can be due to poorly written code that can take several seconds to process, or poor SQL tuning and improper indexing causing stored procedures and other SQL commands to consume valuable time. Processing delays directly impact response times. To get the most gain out of our tuning efforts, we typically focus on delays longer than 1 second. However, your application may have stricter or higher standards depending on a number of variables including type of application and size of your user base. For example, if your application is designed to render large reports to a small group of decision support analysts, response time may be expected to be slower. This is because larger reports may take longer to process on your database server, and given that your user base is small, budget constraints may limit the amount of time you can spend optimizing this application. However, if your user base is very large and consists of customers ordering your products, you will spend more time optimizing the application’s response time to ensure that no sales are lost because customers are frustrated about slow response times.

Reducing Processing Delays

The most common way to speed the response time of your application is to reduce application-processing delays. This is accomplished by speeding up slowly executing ASPX, Managed Code, and poor SQL code. More details are available in the IIS, Managed Code, and SQL sections of this book. As discussed earlier in the "Identifying Application Processing Delays" section, by using Network Monitor display data view or Application Expert bounce diagrams, you can identify whether or not your page view and associated elements have processing delays and which tier is causing it. Next, determine where in your application’s code the processing delay is happening. There are several methods for profiling and identifying the code causing processing delays:

  • With .NET applications you can enable tracing on your ASPX pages. After you request an ASPX page with your browser, the statistics and timing will be located at the bottom of your page view. To enable tracing at the page level, add the ASPX page directive Trace="True”, as shown in Figure 5-2.

    Enabling tracing on ASPX pages
    Figure 5-2. Enabling tracing on ASPX pages
  • With standard ASP applications, you can use timers in your code to identify problems. Simply add timing variables throughout your script and write the values to a text file. This method of ASP profiling will allow you to narrow processing delays to a particular function or line of code. This book’s companion CD includes examples of the ASP timing code for VBScript and JScript, which are called ACETimer­VB.doc and ACETimerJS.doc. Many times these delays are related to a specific call to a custom component that is inefficient or a SQL command that is taking several hundred milliseconds or even several seconds to execute.

    Note

    A simple profiling approach is to insert response.end in your ASP page where you suspect the processing is occurring. When this ASP page is loaded, the script will exit when this command is executed, exposing your processing delay. If no delay occurred, move the response.end command farther down in your ASP page and load again. Eventually you will narrow down the portion of your script causing the processing delay.

  • The easiest way to identify SQL bottlenecks and processing delays is to use SQL Profiler. Simply create a SQL Profiler trace file while you request your page view. Any delays caused by SQL commands or stored procedures will show up in the Duration field of the trace file in milliseconds. Once you have identified these poorly performing SQL commands or stored procedures, you can work on optimizing them. For more information on optimizing your SQL commands and stored procedures, see Chapter 8.

Response Times

In reference to performing an application network analysis, response time refers to how long it takes data to travel from the client’s initial request to the completion of the request. Improving performance of your application is synonymous with reducing the overall response time for each of your application’s page views including associated elements. Some factors that constrain response times are a high number of round trips, low bandwidth, end users with high latency connections, a large amount of data transferred, and processing delays on the IIS code, managed code, or SQL code. We describe the process of using Application Expert to quickly calculate response times later in this chapter.

Response time acceptability depends on a variety of factors including the type of application, the function of each requested page within the application, the bandwidth and latency of your Internet connection. For instance, a requested page that has no interaction with a back-end database (that is, a static page view) or has a small amount of content should load faster than requested pages that are heavy in content or constantly retrieve or update data from a database (that is, a dynamic page view) will be slower. Table 5-4 shows the response times we consider acceptable when performing an application network analysis. Low response times represent applications with small static page views or very light interaction with a database. High response times represent applications with large page views or heavy interaction with a database.

Table 5-4. Acceptable Response Times

Connection Speed

Low Response Time

High Response Time

Low speed (modems)

10 seconds

15 seconds

High speed (DSL, cable, or higher)

5 seconds

10 seconds

User Scenarios

User scenarios are a collection of page views, including their associated elements, that implement business or functional processes. For example, searching the IBuySpy site (discussed in Chapter 3) is a good example of a real-world user scenario. The search scenario consists of several steps, such as loading the home page, entering a search string, clicking the GO button, selecting a product from the search results and viewing the product detail page. This scenario consists of two page views. Instead of capturing the entire user scenario, we recommend you conduct this analysis by separating the scenario into distinct user actions, like clicking a button or link to submit a form that makes a request to the Web server. The reason we isolate the user scenarios into separate page views or user actions is to help identify the exact causes of slow response times.

Identify User Scenarios

The IBuySpy .NET sample application utilizes typical e-commerce functionality. In the following example we have broken the search user scenario into three separate page views, including their associated elements:

  • Step 1

    The user views the home page, loading the Home.aspx or Default.aspx page.

  • Step 2

    The user enters a search string in the search field and clicks GO, loading the “SearchResults.aspx” page.

  • Step 3

    The user selects or clicks a product returned by the search, loading the ProductDetails.aspx page.

If your application is already deployed, you can identify scenarios by either focusing on pages that users have complained about, or by walking through the application and identifying pages that load or execute more slowly. The second method requires that every application page is hit. In some applications this may be unreasonable. However, if you have never performed an application network analysis on the application, this is a good way to establish a response time baseline. Also, if you are working on a new application, this method is more useful because you can identify and fix poorly performing pages before going live.

Now that we have defined the terminology, the next section of this chapter describes the tools available with which to conduct an application network analysis.

Using Microsoft Network Monitor

Network Monitor is a software-based network sniffer that can be used to analyze and troubleshoot data transferred between nodes and devices on a network. This tool is designed for several types of Information Technology (IT) disciplines. Network administrators often use Network Monitor to capture and monitor overall network utilization. Network Engineers may use Network Monitor to assist in troubleshooting potential bottlenecks in network designs and architecture. Developers may use Network Monitor to troubleshoot their code. In an application network analysis, Network Monitor is primarily used to identify the amount of data transferred and count the number of round trips used in response time calculations per page view, including associated elements or user actions performed that generate activity to the Web server.

Network Monitor for Windows 2000 is available in two versions:

  • Network Monitor 2 Lite is available with Windows 2000 Advanced Server and Data Center editions. This version can only sniff network traffic from the local Network Interface Card (NIC) to other nodes communicating with it.

  • Network Monitor 2 Full is available with Microsoft System Management Server (SMS) 2. This version allows traffic to be captured for all traffic on a network from a single location that has the Network Monitor driver installed.

Network Monitor captures frames of network data to help you detect and analyze network problems. It aids in tracking down problems with network applications by capturing data transferred between application tiers, network round trips, network time, and processing delays.

MAC Address and IP Address Setup

In preparing for your network captures, you should document all node MAC addresses and IP addresses. To do this, open a command prompt and type ipconfig/all from each back-end server and client. The output from this command will show the IP address information, DNS servers, DNS suffix, physical or MAC address, and other valuable information. This will make it easier to set up your capture filter and isolate network traffic created by the application. Often you can use a host file entry to force nodes to communicate with the correct NIC and IP addresses you are capturing on. The hosts file is typically located in the C:windowssystem32driversetc folder and does not have a file extension. To add or change entries you can open the hosts file with Microsoft Notepad and follow the examples provided within the file.

Note

If you are using a client or server that has more than one NIC, make sure you either disable the extra NIC or ensure all traffic communicates on the same NIC.

Configuring Network Monitor Settings

Network Monitor needs to be properly configured before capturing data from your user scenarios. There are three key settings—the capture filter, capture buffer, and network—that can be adjusted to make sure you are creating a correct and complete capture.

Capture filters allow you to narrow down your network captures to the tiers or nodes that are used by your application. This makes it easier to isolate data transferred and round trips without analyzing unnecessary network traffic in the trace file. Figure 5-3 shows a typical capture filter.

Network Monitor capture filter
Figure 5-3. Network Monitor capture filter

The capture buffer is an important setting to adjust. By default the buffer is set to 1 megabyte. If a page is transferring a large amount of data you may exceed this 1 megabyte limit. Typically we adjust the capture buffer to 10 megabytes to accommodate any large captures. Figure 5-4 shows the Network Monitor Capture Buffer Settings dialog box.

Network Monitor Capture Buffer Settings dialog box
Figure 5-4. Network Monitor Capture Buffer Settings dialog box

It’s important to make sure you capture on the correct network. With clients and servers that have more than one NIC, you need to set which network you want to capture on. To verify you are capturing on the correct network, start a Network Monitor trace and ping the IP address or URL of the Web application you are testing. Next, stop your Network Monitor trace and verify you collected the ping traffic. If not, switch Network Monitor to capture a different network and repeat until you capture on the correct network. Figure 5-5 shows where you set Network Monitor to capture on the proper network.

The Network Monitor Select A Network dialog box
Figure 5-5. The Network Monitor Select A Network dialog box

Environment Setup

The hardware used in an application network analysis includes the test client, and all of the back-end servers that make up the application (IIS Server, SQL Server, Application Server) and any other network devices used (switch, hub, router, bridge, load balancer, etc.). Applications that require high availability and scalability typically use more than one identical Web server to load balance traffic volume. If your application is load balanced, you should ensure that only a single node (front-end Web server) is enabled during an application network analysis. The purpose of this is to make sure you are capturing traffic on the correct Web server. There are numerous ways to use Network Monitor to capture traffic created by your application. Here are a few:

  • Most applications are made up of servers connected by a network switch, because every port has dedicated bandwidth and performance is better. Network switches isolate traffic from each port, which makes it impossible for Network Monitor to see traffic from each application tier. However, through port spanning or port mirroring you can configure most network vendor switches to copy or mirror all traffic from each port you assign. Consult your network hardware vendor for instructions on configuring port spanning. By using the SMS version of Network Monitor and plugging the network monitor capture client into this port, you can see all the traffic from each of your application tiers. Figure 5-6 illustrates this model.

    Using port spanning on your switch
    Figure 5-6. Using port spanning on your switch
  • If you do not have access to your switch configuration or if port spanning is not an option available with your network switch, another simple approach is to plug all back-end servers that make up your application into a hub. Hubs share bandwidth amongst all ports; therefore, the machine you use as your network monitor client will be able to capture traffic from all tiers. Figure 5-7 illustrates this model.

    Isolating your network with a hub
    Figure 5-7. Isolating your network with a hub
  • The full version of Network Monitor allows you to install a Remote Network Monitor Driver on each tier of your application to capture traffic remotely. If you choose this method, install the Remote Network Monitor driver on each of your application tiers. From the Start menu, choose Control Panel, and then choose Add/Remove Programs. In the Add/Remove Programs dialog box, click Add New Program. Navigate to Windows Components, then choose Management and Monitor Tools, select Network Monitor Tools, and click OK. This method allows you to gather the captures from all remote agents to one client. The benefit of this approach is that it’s quicker than performing separate captures to get the data from all of your Web applications tiers. However, the disadvantage is it takes longer to setup since you have to install an additional component on each server. Figure 5-8 illustrates this model.

    Using Network Monitor remote drivers
    Figure 5-8. Using Network Monitor remote drivers
  • The easiest method for capturing traffic is to use the Network Monitor 2 Lite version on the IIS tier as your capture client. The IIS tier is typically located between the Internet Explorer client and SQL tier. Therefore, when the network monitor client is located on your IIS server you will be able to see all the traffic coming to and from it. Figure 5-9 illustrates this model.

    Using the IIS tier as your Network Monitor client
    Figure 5-9. Using the IIS tier as your Network Monitor client

Capturing Network Traffic

Now that Network Monitor is installed and configured correctly and your environment is set up, you are ready to begin capturing network traffic. We have discovered a few tricks that will assist you in gathering captures:

  • Because we typically break user scenarios down into individual user actions, we recommend creating a separate capture for each page view. Using this method easily identifies how much data is being transferred for each page view including associated elements. If you are looking for scenarios that are expensive in terms of data transferred or round trips you can sum the individual page views.

  • Perform your Network Monitor captures several times to verify their integrity. In approximately 90 percent of the network analyses we have performed, the network capture is accurate, however, unless you do your captures a few times to verify, you can’t be sure. We re-run each capture at least three or four times until we get consistent and repeatable results. Each sample should be similar if not identical in terms of round trips and data transferred.

  • Network Monitor allows you to save the captures files (CAP), which can be used for further analysis or importing into third-party tools such as Application Expert.

  • Save your Network Monitor filters and address database (discussed above) in case you need to recapture. Saving your filters will save time reconfiguring Network Monitor. Figure 5-10 and Figure 5-11 show the Save Capture Filter and Save Address As dialog boxes.

    The Network Monitor Save Capture Filter dialog box
    Figure 5-10. The Network Monitor Save Capture Filter dialog box
    The Network Monitor Save Addresses As dialog box
    Figure 5-11. The Network Monitor Save Addresses As dialog box
  • The goal of the capture is to record only pertinent application data transferred between nodes. To achieve this, start the Network Monitor capture, request a page by typing a URL in the address window of a browser, then stop the Network Monitor capture as soon as the page finishes loading. The page is considered finished when your Internet Explorer client displays Done in the lower left-hand corner of the status bar. This will allow you to avoid excess traffic transferred after the page view is loaded.

Network Monitor Capture Structure

A Network Monitor capture file consists of two views, the capture window and the display data view. As illustrated in Figure 5-12, the capture window calculates the amount of data transferred between nodes.

The Network Monitor capture window
Figure 5-12. The Network Monitor capture window

The display data view contains nine columns and can contain many rows, depending on the amount of data collected. By default the trace file will show the MAC address of the NIC. To make the trace easier to read, edit the address to show the machine name or machine type. Figure 5-13 illustrates a raw capture from a client browser to an IIS server to a SQL server and back.

The Network Monitor display data view
Figure 5-13. The Network Monitor display data view

All data in these views is important, however, the critical data to focus on identifies the amount of data transferred, number of round trips, and total time.

Using Compuware’s Application Expert

Application Expert provides advanced response time prediction capabilities and granular application-level details for tuning distributed applications to ensure optimal network performance. Application Expert is used as a packet sniffer or for importing binary capture files obtained through Network Monitor. Application Expert also can be used as a fully functional packet sniffer. We find the following features of Application Expert to be particularly useful when performing a network analysis:

Conversation Map

Once a network capture has been imported into Application Expert, you can model the conversation between applications tiers. Figure 5-14 shows the conversation map of IBuySpy home page (no cache). This figure shows how quickly the conversation map is used to determine the amount of data transferred and number of round trips for a page view including its associated elements.

Application Expert conversation map
Figure 5-14. Application Expert conversation map

The conversation map provides a top-level view of the nodes (Client, IIS, and SQL) and conversations associated with hitting the home page. The conversation is defined as the data transferred or communication between the various nodes in your application. You can view the conversations by bytes or select your choice of display metric, such as payload bytes, frames, or application turns or round trips by right-clicking to open the Conversation Map context menu. Referring back to Figure 5-6, we see a total of 46 kilobytes of data being transferred between the IE client and IIS server and a total of 18 round trips.

Bounce Diagram

The bounce diagram is an excellent feature that gives you the packet level view of your application tiers and allows you to identify processing delays. Figure 5-15 shows the IBuySpy Default.aspx bounce diagram.

Application Expert bounce diagram
Figure 5-15. Application Expert bounce diagram

The bounce diagram is a packet flow timing diagram for client/server conversations on the network. This view shows individual frames between nodes in the sequence in which they occurred during the capture. In Figure 5-15, the IBuySpy login page shows a very small processing delay of approximately 170 milliseconds between the Internet client and Web server.

In the bounce diagram, each vertical line represents a node and the horizontal lines on the grid represent relative time increments in seconds. The time is relative to the start of the trace, which is designated 0.00. Within the diagram, the colored horizontal lines represent captured frames. The size of each frame is indicated by a color described in the legend at the bottom of the window: red for fewer than 100 bytes, yellow for up to 512 bytes, green for up to 1024 bytes, and blue for more than 1024 bytes.

Thread Analysis

It is helpful to look at the threads and thread timing using the thread analysis view in conjunction with the bounce diagram to identify which requests are causing processing delays. This combination view lets you focus thread-by-thread. The panes are dynamically linked, so an action in the upper pane affects the display and data in the lower pane to give you multiple views. For example, when you click a thread in the upper pane, the display in the lower pane changes to show the frames associated with the selected thread. If necessary, Application Expert automatically zooms into the bounce diagram for you. When you click a frame displayed in the bounce diagram, you get the detailed information on that thread. Figure 5-16 shows a thread analysis of the IBuySpy Default.aspx page. Using the thread analysis feature in Application Expert, you can quickly identify all 16 objects associated with this page view. Identifying this information from the raw Network Monitor capture or Application Expert packet trace view takes much longer.

Application Expert thread analysis
Figure 5-16. Application Expert thread analysis

To analyze your capture in more detail, drill into the packet trace for a specific frame by selecting the Drill Into Packet Trace option in the context menu or, in a bounce diagram view, double-clicking a frame. This view is similar to the way Network Monitor displays the raw capture. The packet trace view lists all of the packets and provides important information about each one including the frame number, acknowledgement number, window size, and total bytes (data transferred) versus payload bytes (total bytes minus overhead of headers and acknowledgement frames). The bounce diagram view, thread analysis view, and conversation map are visual representations of the raw data provided in the packet trace view. Figure 5-17 displays a packet trace of the IBuySpy Default.aspx page.

Application Expert packet trace view
Figure 5-17. Application Expert packet trace view

Response Time Predictor Tool

The Response Time Predictor allows you to predict the impact of bandwidth and latency for overall response time. This is very useful in determining response times of your Web pages in a pre-production test environment. Having this data you can identify and fix performance problems before your customers begin using your application. For instance, if you have several page views that do not meet your criteria for response time acceptability, you have a chance to optimize them before your customers begin using your Web application. The predicted response time depends on a number of factors, including the number of network round trips, amount of data transferred, and processing delays which are modeled using algorithms developed by Compuware. In the Response Time Predictor, you specify the bandwidth and the latency parameters to characterize the production network. The bandwidth and latency should be defined for the slowest link between the communicating end nodes. Figure 5-18 shows a Response Time Predictor model for IBuySpy Home page.

Application Expert Response Time Predictor
Figure 5-18. Application Expert Response Time Predictor

Interpreting Network Captures with Application Expert

In previous sections of this chapter we identified and defined key components that are used throughout the application network analysis. We introduced Network Monitor, the application used to capture the network traffic between application tiers. Next, we will provide our method for analyzing applications for network efficiency and identifying response time bottlenecks.

The capture file is in a format that can be viewed in Network Monitor or imported into Application Expert. The capture file is not easily interpretable and can be intimidating for novice users. By using Application Expert to interpret the capture, valuable time can be saved. To import your Network Monitor capture files into Application Expert, follow these steps:

  1. Open Application Expert.

  2. Create a new application.

  3. Open Windows Explorer and browse to the location of your capture files.

  4. Drag and drop your capture files onto your newly created application.

Calculating Data Transferred

After performing the network captures, we isolate traffic between application tiers. Calculating data transferred with Application Expert is accomplished using the conversation map. Figure 5-19 shows there are approximately 15 kilobytes of data transferred between the Internet Explorer client—IIS server tier and 4 kilobytes of data transferred between the IIS server—SQL server tier for the IBuySpy Checkout.aspx page view including their associated elements.

Calculating data transferred with Application Expert
Figure 5-19. Calculating data transferred with Application Expert

Counting Network Round Trips

Counting the number of network round trips is accomplished using the Application Expert conversation map. Figure 5-20 shows there are five round trips between the Internet Explorer Client—IIS server and 10 round trips between the IIS server—SQL server for the IBuySpy Checkout.aspx page.

Counting round trips with Application Expert
Figure 5-20. Counting round trips with Application Expert

Identifying Application Processing Delays

Processing delays on the IIS or SQL server tiers will critically impact end user response time performance. These delays are caused by several factors such as slowly executing scripts or components in your ASPX pages, SQL stored procedures requiring optimization, or improper SQL indexes that add seconds to your page load time. There are a number of tools and methods you can use to determine if your application has a processing delay. One such tool is SQL Profiler to monitor the SQL server tier, looking at the IIS logs “time taken” field to estimate IIS processing duration, or using the Application Expert bounce diagram feature to identify excessive time between network frames.

Note

For debugging and testing purposes we recommend enabling logging within IIS and using the W3C Extended Log file format. This includes enabling all of the extended properties, such as time taken, bytes sent, and bytes received. For more information relating to the W3C Log file format, see Chapter 6.

If you find delays of more than a second between frames, this should be flagged and investigated for optimization. If you reduce this delay by making code changes, the overall response time for that particular page view will be reduced by the same amount. Figure 5-21 shows a 1.3-second processing delay on the IIS server tier for the IBuySpy update cart page.

Processing delay shown in Application Expert
Figure 5-21. Processing delay shown in Application Expert

Predicting Response Times

The Application Expert Response Time Predictor allows us to model response times using the quantity of data transferred, round trips, and processing delays in our network capture. These models show the response time predictions for different line speeds and network latencies, allowing you to discover if your application will perform as you expect before you roll it out to your customers.

Note

An alternate method for predicting response times at various connections speeds and latency is to use a hardware-based WAN simulator. Hardware WAN simulators are located between your Web application tiers and suppress the network signal to the programmed specification. For example, you can place the simulator between your test client and Web server tier and program it to reduce your connection to 56 kbps and 500 milliseconds of latency.

We typically use a mix of slow modem connections, high-speed broadband connections (DSL or cable modems), and typical office connections like T1, and LAN connections. For each of these connections you can do a best case and worst case latency. Keep in mind, the bandwidth and latency metrics used in these models are not set in stone. From our experience we use the following connection speeds and latency to simulate users:

  • 56-kbps modem connections have a 200-millisecond latency best case and a 500-millisecond latency in poor conditions.

  • 256-kbps DSL and cable modems have a 50-millisecond latency best case and 200-milliseconds in poor conditions.

  • T1 (1.54-mbps) connections have a 50-millisecond latency best case and 100-milliseconds in poor conditions.

  • LAN connections represent a 10- or 100-mbps connection, depending on your network infrastructure. Commonly you will have a 10-millisecond latency or less and 50-milliseconds in poor conditions.

As shown in Figure 5-18, the Application Expert Response Time Predictor allows you to change the line speed and latency for each of your applications tiers. The response time formula utilizes connection speeds, data transferred, round trips, latency, and processing delays. Table 5-5 demonstrates a typical response time model for the IBuySpy home page (no cache page) using our model with varying connection speeds and latency metrics.

Table 5-5. Modeling Response Times

Line Speed

56 kbps Modem

256 kbps DSL

1.54 mbps T1

10 mbps LAN

Latency

200–500 ms

50–200 ms

50–100ms

10–50ms

Response Time

6–9 seconds

2–3 seconds

1–1.5 seconds

.5–1second

Conclusion

An application network analysis is useful for identifying performance bottlenecks and improving end-user response time. Incorporating this into your development process helps detect performance issues in terms of response times, processing delays, and quantity of data transferred. Now that you have used the techniques in this chapter to identify where your application needs to be optimized for improved response time performance, the next three chapters will help you identify specific areas in each tier that can be tuned for performance.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset