摘要:
要控制HttpWebRequest在10秒内timeout, 设置两个属性即可,Timeout, ReadWriteTime但在异步模型中,.net framework却没有帮我们实现timeout.http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.begingetresponse.aspx如链接中所讲,In the case of asynchronous requests, it is the responsibility of the client application to implement its 阅读全文
摘要:
用HttpWebRequest去Call别的Service,怎样才能提高并发量和性能?因为建立一个TCP连接要三次握手,.Net 默认使用 keepAlive = Ture 去重用连接,避免重建Connection的开销,还有一些设置我们也要注意:DefaultConnectionLimitdescription: Maximum number of concurrent connections to a single ServicePointdefault: 2suggested: 12*N, N is the number of CPUMaxServicePointIdleTimedesc 阅读全文
摘要:
在windows services开发中,碰到一个奇怪的问题:有时可以启动,有时启动超时,经过漫长的分析(有引用其它的组件),发现问题出在Performance counter的创建上,sometimes, the code will be hang here.Link:http://www.pcreview.co.uk/forums/strange-performance-counter-performance-problem-windows-service-application-t2781664.html解决方法:将Performance Counter操作放到OnStart方法中,不要 阅读全文