Performance degradation worsens over time

I am working on a client-server solution using .NET 2.0 Remoting (server activation, binary formatting over TCP, Vista Ultimate) for communication purposes. I am currently profiling the application and running everything on the same machine. I noticed that if I run the application, everything works fine for several minutes, and then suddenly every remote call takes several seconds. I have an entrance at both ends and every call. Server-side implementation only takes a fraction of a second, while the entire remote call is slow. Further profiling showed that remote defragmentation is on the server side: during internal operation of the remote service, it takes about a split second, the answers are very slow. If I restart the server, everything will return to normal again within a few minutes.

Has anyone experienced something like this?

Thanks!

UPDATE: I checked if I set the lifetime for my remote object, say, for 1 day, I still have the same problem.

UPDATE: I use the template suggested by Ingo Ramer ( HOWTO: use remote objects based on the interface with the configuration files ) for all my deleted things, if that matters.

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)); } 

On the server side, there is nothing but the correct configuration file, which looks like this:

  <service> <wellknown mode="Singleton" type="MyDomain.SomeDomain, MyDomain" objectUri="SomeDomainService" /> 

I do nothing except RemotingConfiguration.Configure ("MyDomainService.exe.config", false); neither on my server nor on client code.

+6
client-server remoting
source share
8 answers

Use a network monitoring tool such as Wireshark to find out if your problem is with the network or is related to server synchronization.

If this proves that this is not a network problem, try connecting a simple user synchronization in the chain (just before the channel) to register and get the time between the hooks.

+1
source share

Never. Are you doing something that causes extra instances of your deleted layer to register / be created?

0
source share

A look at your code or a subset of it will also help.

0
source share

Do you sponsor your remote sites with a customer sponsor?

0
source share

I changed my type of remote access channel from tcp to http, leaving binary formatting. I see the same slowdown for several minutes of inactivity, but, unlike tcp channels, after the client makes a “slow” remote call, the server wakes up and all subsequent calls are fast until the next period of inactivity appears and the server falls asleep again.

In no case is this a solution, but at least some kind of workaround.

0
source share

This may be due to the lease term. The Singleton object depends on the lease period that was specified for it, so it can be recycled even if customers currently refer to it. You can create the old Singleton object type by overriding the InitializeLifetimeService method for MarshalByRefObject.

0
source share

Can you try the MTAThread attribute for your class, just a thought ...

0
source share

Do you accidentally make a large number of remote calls? If you make calls fast enough, you may have a shortage of threads to process requests.

This is probably not your problem, but I came across this before, so I decided to pass this on.

0
source share

All Articles