开发者

ServicePointManager Monitoring HTTP Requests

开发者 https://www.devze.com 2023-04-08 10:59 出处:网络
I am working with an application that sends hundreds of HTTP requests a minute to different URIs. Is there any way to monitor the connections the application has created?I found that the ServicePointM

I am working with an application that sends hundreds of HTTP requests a minute to different URIs. Is there any way to monitor the connections the application has created? I found that the ServicePointManager is great for inspecting a particular domain, but it requires a URI to na开发者_StackOverflowrrow the scope. My problems would be solved if the ServicePointManager exposed a listing of all connections currently being made and their concurrent connection counts.

   Uri uri = new Uri("http://www.google.com");
   ServicePoint sp = ServicePointManager.FindServicePoint(uri);

Why do I want to do this? I am trying to diagnose timeout exceptions on requests that have 30 seconds to complete and return simple JSON. (The timeout does not happen every on every request) It seems like there shouldn't be a reason for the timeout. Maybe I am running out of available connections because I've exceeded the 96 I have available from the ServicePointManager, and thats my bottleneck. While unlikely, thats the only thing I can come up with right now. Suggestions?


What are you currently using? Windows Performance Monitor?

JPSanders in his excellent blog post on ServicePointManager suggests using Netmon

0

精彩评论

暂无评论...
验证码 换一张
取 消