SUPPORT:67273 | Problems with sending events

Applicaton crash with use many send events.

I have problems with sending events from my server.

When certain events are triggered by the server, the process consumes many threads. These threas are not destroyed, causing the server to crash and bring down all connected users.

The error is very specific. It only happens when there is plenty sending events from the server.

I try change this parameters, but server application crash anyway.
ROServer.ThreadPool.MaxThreads: = 1000;
ROServer.ThreadPool.PoolThreads: = 1000;
ROServer.ThreadPool.MaxQueue: = 1000;

Has anyone ever experienced this and solved it?

Thanks.

Hello,

What platform do you use (.NET or Delphi)?

Delphi XE2.

Hello,

Delphi XE5.

Sorry, XE2

Someone can help me?

we are working with this issue

Ok. Thanks.

Can you update your server application, which you sent to support in #67273 as :

procedure TMonitorServer.Login;
begin
  CreateSession; //added
  RegisterEventClient({$IFDEF UNICODE}WidestringToAnsiString{$ENDIF}(GuidToString(Session.SessionID)), EID_OnMonitoria);  //moved from other event
end; 

and retest? it works for me, i.e. all events were finally received by clients and nothing was crashed.

also these settings works for me:

ROServer.ThreadPool.MaxThreads:= 10;
ROServer.ThreadPool.PoolThreads:= 10;
ROServer.ThreadPool.MaxQueue:= 100000;

Hi. Thanks for the answer.

I moved the RegisterEventClient OnCreate event for TMonitorServer.Login.
Also assign the value of threads as requested.

However, there was the crash clients.
Send to suport@remobjects.com the source code of the project with a printscreen showing the crashes.
I tried to leave the RegisterEventClient in TMonitorServer.RORemoteDataModuleCreate and also in TMonitorServer.Login, but some access violations occurred in clients.

Hi EvgenyK.
Any news for me?

Thanks.

I can reproduce a problem with your testcase. Still investigating…

Ok, thanks.

PS: I realize that I could send as much (very much) events to the clients, something happens to send those events that causes a delay in processing. When this delay happens, the threads stack and how I do not stop sending events, the server can not process the threas that stacked and so it goes to the windows not release more threas the server, causing the crash.
Do not know if this story helps you with something, but thought be interesting to tell you what I think happens.

do you need to use super channels and receive events immediately as they were sent?
I think, if you use plain http channels, it can improve situation in general because these channels can ask server for new events periodically instead of receiving events immediately.

Unfortunately need to receive events as they happen. I used EventReceiver to monitor what happens to the user when he happen.
Example: If he hang up a call or answering, I need to know when it happened, because I have to monitor your system.
If I use an HTTP channel, I have to keep asking the server the user action at all times. I will probably flood the server so requests.

Can you retest your system with plain http channel, where is KeepAlive set to True (client and server) and client asks server for new events every 1-5 seconds?
I think, it will work better in your testcase.

Today, my server is a “proxy”. I do not have pointers to store memories what is happening with the member to inform clients when prompted.
My server is just a propagator of messages from another server.

If I reverse …
Transforming each of my client on a server. And my current server to a client.
Does the server will support the high number of requests?

This way I would not travel with events but with requests to the server. This way I can even work with HttpChannel.
Would have to change some things on the server to control ports and IP addressing, but I think it is doable.

Have you reached any progress?

Hi.
The change is very hard

Still working…

Hi.
I tried to do, but there are controls that I need to do to connect with clients (IP and port) that proved too complicated to implement.
I’ll try to implement without HttpChannel EventWriter as you had indicated.

Can close my “talk”, please.
Thanks