Which parameter to set to fix Package too large error

For a huge insert operation (200k records) our ApplyUpdates() fails with exception “Package too large”

On the client side we already set this parameter
ROSynapseSuperHTTPChannel.MaxPackageSize:=1073741824;
but the error remains.

What parameter should be set (client side/server side) to fix this?

On a side note: Does RO/DA support BCP insert for speed purposes?

Regards,
Frederic

FYI:

I just tried adding

      var message = new RemObjects.SDK.BinMessage();
      message.MaxDecompressedMessageSize = Int32.MaxValue;
      message.MaxMessageSize = Int32.MaxValue;
      message.EnforceMaxMessageSize = false;
      internalROServer_.NetworkServer.RegisterServerMessage(message);

on the server side but this does not change anything

Hi,

this is SuperHTTP option.
so increase IpSuperHttpServerChannel.MaxPackageSize value, similar to client-side.


you can upload bcp’s output file to server-side and use bcp for inserting data.

Setting MaxPackageSize server side works.
Note: I initially set it to int.MaxValue but this made the RO service totally unavailable

Hi,

int.MaxValue breaks current logic:

        public override Int32 MaxPackageSize
        {
            get
            {
                return base.MaxPackageSize;
            }
            set
            {
                base.MaxPackageSize = value;
                this.Server.MaxPostSize = value + 1024; //<<<<<<<<<< negative value
            }
        }

Different error when sending large packages to tcp server.

We have a similar problem for TROIndyTCPChannel.
Here we do not get a nice error message, instead we get a socket exception.

Server side (.NET) we have IpTcpServerChannel (which does not have a MaxPackageSize
We set a max message size on the server side
image

Client side (delphi) we have TROBinMessage and TROIndyTCPChannel.

Can you tell me how to support large packages for the TCP channel?

Hi,

TCP channel itself has no limitations.

I’d recommend to not set max values.
try to retest, say with 1 gb ( 1 * 1024 * 1024 * 1024 = 1073741824 bytes ) or something similar.

What exactly do you suggest I change? The server side limitation?
This int.MaxValue has been in the code for a long time. Changing this does not solve the issue.

Can you deduce something from the callstack?
The ‘Connection reset by peer’ exception is not very explanatory.

Hi,

You are using TROIndyTCPChannel. this is wrapper for native TIdTCPClient class.
I can suggest to check sources of Indy for this error.

according to call stack, something is happened when data was sent inside TIdIOHandler.

I analysed the problem a bit

What happens is that RO tries to write/send 100MB to a TCP stream.

This triggers the ‘connection reset by peer’

Where could the limitation be?
How can we increase it?
We very rarely have large updates but we want them to succeed of course

Hi,

what channel & platform is used on server-side?

The server is .NET

server.NetworkServer.ServerChannel = new RemObjects.SDK.Server.IpTcpServerChannel();
server.NetworkServer.Port = 7789;
int maxMesSize = 1 * 1024 * 1024 * 1024;// int.MaxValue;
BinMessage message = new BinMessage();
message.MaxMessageSize = maxMesSize;
message.MaxDecompressedMessageSize = maxMesSize;
server.NetworkServer.RegisterServerMessage(message);

Hi,

You should set IpTcpServerChannel.SecurityOptions.MaxRequestSize too like

      var maxMesSize: Integer := 1 * 1024 * 1024 * 1024;// int.MaxValue;
      var ch := new RemObjects.SDK.Server.IpTcpServerChannel();
      ch.SecurityOptions.MaxRequestSize := maxMesSize; //<<<<<<<<<<<
      server.NetworkServer.ServerChannel := ch;

I have done this but this does not solve the issue.
I still get ‘connection reset by peer’

To be clear, the error message changed from a clear/proper "Package too large” exception to a less informative and probably lower-level “connection reset by peer” error, now, but it still only happens on large requests? To me the sound like something else is going on, a disconnect on TCP stack or lower network level, not in Remoting SDK. Is this with a direct connection between client and server, or could there be any network infrastructure in-between that might enforce limits?

Update: also, can you tell whether this fails while sending the request (e.g. before the server ever receives/executes it on high RO/DA level), or the way back (eg when the server sends the response)?

Hello,

The server and client run on my development machine.
The network is not the issue.
The software works fine and many RO calls occur before

At present the error is in the ApplyUpdates

I can bypass the issue by performing multiple (smaller) ApplyUpdates.
So in some loop I write
if FProductPrijsTable.Delta.Count>=ctMaxLoadRecords then
FProductPrijsTable.ApplyUpdates();

ctMaxLoadRecords =1000 for now

Hi,

can you retest my testcase, pls?

testcase.zip (68.0 KB)

Hi,

Your test case works.
The solution you proposed was the correct fix.
Unfortunalty via name completion I wrote
channel.SecurityOptions.MaxRequestTime=maxMesSize;
and I was able to look over this error of mine for the past 6 hours :frowning:

By putting
channel.SecurityOptions.MaxRequestSize=maxMesSize;
the code works fine.
The MaxRequestTime even explains the ‘connection reset by peer’.

Sorry for the trouble & thanks for the help