XData Server shuts down

Greetings,

I have an XData Server Application. I'm sending 100 requests/min to test the stability of the server. When the XDataConnectionPool.Size is set to 20, the server shuts down almost immediately. Setting the Size to 100.000 prevents the server from shutting down, but the client doesn't respond at all. Moreover, Google Chrome CPU usage goes through the roof at other users who are not sending that many requests (might be because of the continuous scroll component with AutoLoadFirstPage set to True; no response means constantly trying = high CPU usage..?)

Anyway, what technical steps do I need to take to make the server as stable as possible, apart from moving over to a different server? Please bear in mind that this is the first of many tests we are going to conduct to test the server, so I'll gladly accept the advices/suggestions involving different aspects.

The (current) server consists of: TSparkleHttpSysDispatcher, TXDataServer, TFDConnection, TAureliusConnection, TFDPhysMSSQLDriverLink, TFDStanStorageJSONLink, TXDataConnectionPool, TFDBatchMoveJSONWriter, TFDBatchMove and TFDBatchMoveDataSetReader.

As you may have noticed, this is practically the same setup Dr. Holger Flick used to demonstrate how to get data from the server and publish them in JSON format.

Can you please try to give as much details as possible, or at least point me into the right direction? For example, there is the XDataConnectionPool.Size and also the Pooled: Boolean property of the FDConnection. Trying to set the Pooled property to True results in an error that I need to configure the TFDManager, but changing the XDataConnectionPool.Size doesn't trigger such an error. Does this mean that they are not the same? Or perhaps XDataConnectionPool.Size is the simplified version of the Pooled property, so you don't need to configure some stuff? Or do I have to set both of the properties to increase the Pool Connection, etc. Details like these are very important for me.

Thank you for your time.

Could you please provide the server project and the client test project so we can have an idea of what we are talking about and give some advice?

XData is a stable product that is of course being used by lots and lots of customers in production, so you are hitting a specific situation (in your code, or XData code).

Hello,

My colleague will send you the Server along with the reproduced Client by mail.

1 Like

I received the project. But I cannot use it, since it requires a SQL Server database which I don't have.
In any case, I see a problem with the code:

function TServices.btQuery(pmQuery: string): TStream;
var
  LResult: TMemoryStream;
begin
  LResult := TMemoryStream.Create;
  ServerContainer.BatchData(pmQuery,LResult);
  Result := LResult;
end;

You are using a global ServerContainer, which is not thread-safe. For each request, you should create a specific TDataModule containing the FireDAC components (the query, the connection, batch, etc.), use it, return the results, and then destroy it. Probably that's the issue you are having.

1 Like