Posted by: Cirilo Meggiolaro | 11/5/2008

Tip of the day #22 – Improve effectiveness during WCF load balancing (NetTcpBinding)

The key to run WCF services that are exposed by NetTcpBinding and running under load balance environment is to set correctly the connection pool properties.

The connection pool has a default behavior of keeping a connection linked to a specific server, what is not good for load balance purposes. For connections with long lifetime this fact can become a problem.

How to…

Transport quotas are the mechanisms that determine when a connection is high-resource consuming and they are divide into three groups (timeouts, memory allocation limits and collection size limits).

The lease timeout is one of the transport quotas available and the first change you need to perform. The default value is 5 minutes. It is recommended to change the value to some seconds (Microsoft recommends 30 seconds) and based on the application features calibrate it until reach the best value to your application. You can set the LeaseTimeout property using the binding element section.

To get a full list of transport quotas, click here!

The default security properties are set to the most common scenarios so the security mode also affects the performance of the services running under load balance. Take a look at NetTcpSecurity class to get more information about how to improve the performance of your WCF service using NetTcpBinding.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: