Freigeben über


Tuning Service Throttles

The first step in tuning a service is figuring out which throttles should be adjusted. The default throttle values for WCF are extremely conservative out of the box, meaning that you almost always will be tuning throttle values upwards. This also means that you can get a lot of information from running your service with a predictable load and identifying the throttles that are being hit.

Unlike many quota settings, there is no obvious impact to hitting a throttle. Instead, requests will get bunched up at the throttle points, causing your entire service to appear slow even though you aren't using all of the available resources of the machine. Quota setting problems are easier to diagnose because requests simply fault instead of just taking a long time. You can identify throttle setting problems by enabling application tracing. Most throttles will trace at the Information level when the throttle value is exceeded. Here's an example configuration file for enabling Information level tracing in your service.

 <configuration>
 <system.diagnostics>
  <sources>
   <source name="System.ServiceModel" 
           switchValue="Information, ActivityTracing"
           propagateActivity="true">
    <listeners>
     <add name="traceListener" 
          type="System.Diagnostics.XmlWriterTraceListener" 
          initializeData= "c:\servicelog.txt" />
    </listeners>
   </source>
  </sources>
 </system.diagnostics>
<configuration>

Next time: Dangers of Application Domain Recycling

Comments

  • Anonymous
    November 21, 2006
    I'm writing a middle-tier service that needs to act as the client. I can get the user name from the client