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>
posted @ Friday, January 23, 2009 12:20 AM
Print

Comments on this entry:

No comments posted yet.

Your comment:



(not displayed)

 
 
 
 
 

Live Comment Preview:

 
«June»
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456