Hello,
I'm working on a client-server solution that uses .NET 2.0 Remoting (server activation, binary formatting over TCP channel, Vista Ultimate) for communication purposes. Currently I'm profiling the application and run everything on the same machine. I noticed that if I start the application, everything works just fine for several minutes and then suddenly each remote call takes several seconds to execute. I have logging on both ends and clock every call. Server side's implementation takes only fraction of a second to execute, while the whole remote call is slow. Further profiling showed that remoting degrades on the server side: while inner working of the remote service execute within a fraction of a second, the responses are very slow. If I restart server everything backs to normal for several minutes again.
Did anyone experience something like that?
Thanks!
UPDATE: I checked, if I configure lifetime for my remote object to, say, 1 day, I still have the same problem.
UPDATE: I'm using the pattern suggested by Ingo Ramer ( http://tinyurl.com/5u8fjq ) for all my remoting stuff, if this makes any difference.
Client code:
public static object CreateInstance(Type type)
{
if (!Initialized)
InitWellKnownTypesCache();
WellKnownClientTypeEntry typeEntry = (WellKnownClientTypeEntry)wellKnownTypesCache[type];
if (null == typeEntry)
throw new RemotingException("Type not found.");
if (string.IsNullOrEmpty(serverObjectActivationUri))
throw new RemotingException("ServerObjectActivationUri wasn't configured. Cannot create server object instance.");
return Activator.GetObject(typeEntry.ObjectType, string.Format(serverObjectActivationUri, typeEntry.ObjectUrl));
}
Server side has nothing but proper config file that looks like:
<service>
<wellknown
mode="Singleton"
type="MyDomain.SomeDomain, MyDomain"
objectUri="SomeDomainService"
/>
I don't do anything beyond RemotingConfiguration.Configure("MyDomainService.exe.config", false); neither in my server nor client code.