Fun with performance testing


I was troubleshooting some performance issues today when I found out about this property:

ServicePoint.ConnectionLimit

I am currently working on a multi-threaded windows application that uses HttpWebRequest to communicate with external web resources. By default, .NET sets this connection limit to 2. Which means there are only 2 threads available for connecting to an external web resource. As a result, when I throttled my app with more than 2 threads, this setting became a performance bottle neck.

To solve the problem, I just had to raise this limit. The optimal setting of this property depends on the processing power of your app server and the load the web resource can handle. To set this property in code, just access the ServicePoint property on the instance of the HttpWebRequest object.

Alternatively, you can also configure this value in your app.config file with the xml below.

<system.net>
    <connectionManagement>
            <add address = "*" maxconnection="20" />
        </connectionManagement>
</system.net>
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted @ Friday, January 23, 2009 12:20 AM
Print

Comments on this entry:

No comments posted yet.

Your comment:



(not displayed)


 
 
 
 
 

Live Comment Preview:

 
«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910