Troubleshooting map service performance with log files - GIS Tutorial
Troubleshooting map service performance with log files

Fine-grained logging down to the layer draw level is available through the logging level Info:Detailed. The detailed logging is especially helpful when troubleshooting performance. In this topic, consider the scenario that you have a map service that's not drawing as fast as you'd like.

Before you go to the logs, it may be easier to catch the problem using the Analyze button on the Map Service Publishing Toolbar. This toolbar can quickly point out areas for improvement in your map document. The map service definition (MSD) files created with this toolbar also result in much faster map services. See Publishing a map service for steps on creating an MSD-based map service with the Map Service Publishing Toolbar.

When you need more detail about what's happening during a map draw, you can go to the log files and enable the new detailed logging. This is the workflow you'd follow:

Steps:
  1. Set the log level to Info:Detailed. If you need help with this, see Specifying the log file location (skip steps 3 and 4 in that topic). While you're looking at the log properties page, note the path to the log file and browse to the log directory in Windows Explorer so you don't have to hunt for the file later.
  2. Make a simple request to your map service by zooming or panning. Note the current time so you can find the request in the log.
  3. Examine the log that was created during your request and note the feature count and elapsed draw time of each layer. For this step, sometimes it's helpful to print the log and use a highlighter pen to note the draw times. You'll immediately see which layers are taking the longest to draw. Also, keep an eye on the feature count to spot inefficient layers. A layer may take only 0.2 seconds to draw at a particular extent, but if the extent only includes 2 features you may have a potential inefficiency.
  4. Repeat this process at several different locations and scales in your map. You want to make sure you analyze a good sample of the symbology and layers in your map.
  5. When you finish, set the log level back to Normal.

The Help topic Map service log codes contains a table of the codes you'll see when analyzing the detailed logging. If you scroll down the topic, you'll also find an example of the codes returned from a simple ExportMapImage request like the one that happens when you zoom or pan the map.

When examining detailed logs, you'll often see the messages "Server Context Created" and "Server Context Released". The time between the creation of the server context and its release is the time that the request spends in the GIS Server tier. If you determine that performance is acceptable in the GIS Server tier but your application is still slow, it's possible that your Web server is the bottleneck or that your application is spending time waiting for available service instances so it can get a server context.

Source: http://help.arcgis.com/