1
votes

I'm trying to migrate a .NEt Remoting app to WCF, right now both services(Remoting and WCF) are living together. I have one client consuming both of this services at the same time and I noticed that in the very first call to WCF service it takes a little bit longer than the first call to .NET Remoting service.

With .NET Remoting service the first call get response almost immediately.

.NEt Remoting first call response time: less than a second.

WCF first call response time: about 2 seconds.

I know that there is some initialization cost for WCF connection to be opened, but how can I accelerate this WCF channel wakeup time ??

Any hint?

2
Unlike forum sites, we don't use "Thanks", or "Any help appreciated", or signatures on Stack Overflow. See "Should 'Hi', 'thanks,' taglines, and salutations be removed from posts?.John Saunders
Which binding are you using? NetTcpBinding?John Saunders
netTcpBinding in both cases.user810917

2 Answers

3
votes

WCF is doing so much more than remoting. There is a cost for this work. Full stop.

Try calling the WCF service before you need it. Consider adding a Heartbeat() or Init() method to the service to trigger the startup process. If the startup is completed by the first call, there should not be a delay for subsequent calls.

1
votes

If you have the option to host in AppFabric then you could use the Auto-Start Feature which is specifically designed to get the application initialized before the first client call.

Benefits of the Auto-Start Feature

When you enable the auto-start feature for a service, the service is up and running as soon as the application that it belongs to is started and before the service receives the first WCF message from the client. Therefore, the service processes the first message quickly because it is already initialized.