Remoting (.NET 1.1) Performance Checklist
From Guidance Share
Jump to navigationJump to search
J.D. Meier, Srinath Vasireddy, Ashish Babbar, Rico Mariani, and Alex Mackman
Design Considerations
- 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.
Activation
- Use client-activated objects (CAO) only where you need to control the lifetime.
- Use SingleCall server activated objects (SAO) for improved scalability.
- 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.
Lifetime Considerations
- Tune default timeouts based on need.
Hosts
- Use Internet Information Services (IIS) to authenticate calls.
- Turn off HTTP keep alives when using IIS.
- Host in IIS if you need to load balance using network load balancing (NLB).
Channels
- Use TcpChannel for optimum performance.
- Use the TcpChannel in trusted server scenarios.
Formatters
- Use the BinaryFormatter for optimized performance.
- Consider Web services before using the SoapFormatter.
Marshal by Reference and Marshal by Value
- Use MBR (marshal by reference) 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 (marshal by value) 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.
Serialization and Marshaling
- Consider using a data facade.
- Marshal data efficiently and prefer primitive types.
- Reduce serialized data by using NonSerialized.
- Prefer the BinaryFormatter.