This is a re-post from 2011 for reference purposes.
A small configuration setting can make a big difference.
I’m currently working on a C# test application which dispatches real units of work through an Oracle Service Bus (OSB) to C++ services on an AIX box. The application uses the Supervisor Pattern where a single dispatcher, using XMPP, sends work to multiple workers on different PCs. The multi-threaded workers connect through WCF to the OSB. The use of XMPP was to get around perceived bottlenecks with WCF, in hindsight it wasn’t necessary.
Despite the XMPP dispatcher (the single bottleneck) being able to dispatch over 200 actions a second (as per SLA), the workers were only dispatching a few a second to the OSB.
After eliminating everything except the simplest thing, I turned to Google for help, and discovered that there is a per-AppDomain outbound connection limitation default of two for each remote server. It can be adjusted via the connectionManagement configuration section. This simple change was all that was required:
<configuration> <system.net> <connectionManagement> <add address=”*” maxconnection=”30″/> </connectionManagement> </system.net> </configuration>
Read more about WPF Performance on this excellent blog.