Remoting (.NET 1.1) Performance Guidelines
From Guidance ShareJump to navigationJump to search
- J.D. Meier, Srinath Vasireddy, Ashish Babbar, and Alex Mackman
- Use .NET remoting for communicating between application domains in the same process.
- Choose the right host.
- Choose the right activation model.
- Choose the right channel.
- Choose the right formatter.
- Choose between synchronous or asynchronous communication.
- Minimize round trips and avoid chatty interfaces.
- Avoid holding state in memory.
- Use CAOs only where you need to control the lifetime.
- Consider the limited scalability offered by CAOs.
- Use singleton where you need to access a synchronized resource.
- Use singleton where you need to control lifetime of server objects.
- Use appropriate state management to scale the solution.
- Use SingleCall SAOs for high scalability.
DataSets and Remoting
- Use the BinaryFormatter for optimized performance.
- Consider Web services before using the SoapFormatter.
- Use IIS to authenticate calls.
- Turn off HTTP keep-alives when using IIS.
- Host in IIS if you need to load balance using NLB.
- Tune Default Timeouts Based on Need.
- Consider using a longer lease time for objects that are expensive to create.
- Consider shorter lease times for objects that consume lots of shared or important resources.
MarshalByRef vs. MarshalByValue
- Use MBR when the object state should stay in the host application domain.
- Use MBR when you need to update data frequently on the server.
- Use MBR when the size of the object is prohibitively large.
- Use MBV when you need to pass object state to the target application domain.
- Use MBV when you do not need to update data on the server.
- Use small MBV objects when you need to update data frequently on the server.