首页 / 软件开发 / .NET编程技术 / 改进.NET应用程序的性能和可伸缩性(三)-Remoting性能
改进.NET应用程序的性能和可伸缩性(三)-Remoting性能2011-12-17 博客园 蛙蛙池塘设计上的考虑Use .NET remoting for communicating between application domains in the same process.在同一进程内使用.NET Remoting为应用程序域间通信。Choose the right host.选择正确的宿主(译注:应该是指IIS,windows service等)。Choose the right activation model.选择正确的激活模型(译注:客户端激活,服务端激活等)。Choose the right channel.选择正确的通道(译注:TcpChannel,HttpChannel等)。Choose the right formatter.选择正确的Formatter。Choose between synchronous or asynchronous communication.在同步和异步通信之间选择。Minimize round trips and avoid chatty interfaces.最小化不必要的来回及避免啰嗦的接口(译注:可能翻译的不准确)。Avoid holding state in memory.避免在内存里保持状态。激活Use client-activated objects (CAO) only where you need to control the lifetime.仅在当你需要控制生命周期的时候使用客户端激活对象。Use SingleCall server activated objects (SAO) for improved scalability.使用SingleCall的服务端激活对象来改进可伸缩性。Use singleton where you need to access a synchronized resource.当你需要访问一个同步的资源的时候使用Singleton激活模式(译注:singletion是说无论多少次请求 服务端都是一个对象在执行调用)。Use singleton where you need to control lifetime of server objects.当你需要控制服务端对象的生命周期的时候使用Singletion方式(译注:可以重写 MarshalByRefObject的InitializeLifetimeService方法)。Use appropriate state management to scale the solution.使用适当的状态管理以提高你的解决方案的可伸缩性(译注:scale不知道在这儿咋翻译)。