Web Services (ASMX 1.1) Performance Guidelines
From Guidance Share
Jump to navigationJump to search
- J.D. Meier, Srinath Vasireddy, Ashish Babbar, and Alex Mackman
Design Considerations
- Design chunky interfaces to reduce round trips.
- Prefer message-based programming over RPC style.
- Use literal message encoding for parameter formatting.
- Prefer primitive types for Web services parameters.
- Avoid maintaining server state between calls.
- Consider input validation for costly Web methods.
- Consider your approach to caching.
- Consider approaches for bulk data transfer and attachments.
- Avoid calling local Web services.
Asynchronous Invocation
- Consider calling Web services asynchronously when you have additional parallel work.
- Use asynchronous invocation to call multiple unrelated Web services.
- Call Web services asynchronously for UI responsiveness.
Asynchronous Web Methods
- Use Asynchronous Web Methods for I/O Operations.
- Do Not Use Asynchronous Web Methods When You Depend on Worker Threads.
Attachments
Bulk Data Transfer
- Consider using a byte array Web method parameter.
- Consider returning a URL from the Web service.
- Consider using streaming.
Caching
- Consider output caching for less volatile data.
- Consider providing cache-related information to clients.
- Consider perimeter caching.
COM Interop
Connections
- Configure the maxconnection attribute.
- Prioritize and allocate connections across discrete Web services.
- Use a single identity for outbound calls.
- Consider UnsafeAuthenticatedConnectionSharing with Windows Integrated Authentication.
- Use PreAuthenticate with Basic authentication.
One-Way (Fire-and-Forget) Communication
Serialization
State Management
Threading
- Tune the thread pool using the Formula for Reducing Contention.
- Consider minIoThreads and minWorkerThreads for intermittent burst load.
Timeouts
- Set your proxy timeout appropriately.
- Set your ASP.NET timeout greater than your Web service timeout.
- Abort connections for ASP.NET pages that timeout before a Web services call completes.
- Consider the responseDeadlockInterval attribute.