Are there known issues with a RO super https server running on Azure?
I am using IpSuperHttpClientChannel and it works on most machines.
It also works on Azure with fast access times.
However on azure after a period of inactivity the client call takes 10 seconds extra.
After this one time speed penalty the speed is OK again.
For example a call takes 0.100 seconds, then about 5 minutes of no activity on the same channel we make the same call again and the call will take 10.100 seconds.
Maybe some firewall on azure throws away idle TCP connections which confues the RO super http channel?
When I trace the issue it is the Dispatch call which takes 10 seconds.
Client side we have:
this.clientChannel = RemObjects.SDK.ClientChannel.ChannelMatchingTargetUri(uri);
this.message = RemObjects.SDK.Message.MessageMatchingTargetUri(uri);
if (message is RemObjects.SDK.BinMessage)
{
((RemObjects.SDK.BinMessage)message).MaxMessageSize = Int32.MaxValue;
((RemObjects.SDK.BinMessage)message).MaxDecompressedMessageSize = Int32.MaxValue;
((RemObjects.SDK.BinMessage)message).UseCompression = true; // FVC: Note: By default true
}
if (this.clientChannel is RemObjects.SDK.IpSuperHttpClientChannel)
{
((RemObjects.SDK.IpSuperHttpClientChannel)this.clientChannel).ConnectTimeout = connecttimeout * 1000;
((RemObjects.SDK.IpSuperHttpClientChannel)this.clientChannel).RequestTimeout = 5601000;
}
Just an idea (i donât use Azure much, myself), but could it be that thereâs a setting where Azure suspends your âmachineâ after inactivity, so it has to be woken up again for the next request?
No, I donât think itâs that. The machine is running lots of tasks.
The issue also seems client channel related. A second instance has a fast response at the exact same time.
Meanwhile I have switched to a regular RO HTTP channel and this fixes the problem.
Ah, curious. so this happens to the client, but only against an Azure server? Iâm afraid Iâll have to leave this for my colleague Anton to look into next week.
Good to know. did you switch only the client, or did you have to switch the server channel too, to hide the issue? (SuperHttp servers can handle standard HTTP client requests, too)
Actually it seems it IS specific to Azure
Azure WAF terminates idle connections after 4 minute timeout.
SuperHttp server channel sends a heartbeat messages to the connected clients.
However the issue is that these messages are used to ping servers to check client - server connectivity and to silently reconnect if needed.
SuperHttp connection consists of 2 Http connections - one for sending requests and another one to retrieve responses from the server.
So apparently client side receives heartbeat messages from the server and assumes that everything is OK. While at the same time its connection used to SEND messages to the server was silently closed by WAF. So the client channel is put into an inconsistent stare (please note that it manages to recover even from this half-closed state).
I believe other firewalls/routers also terminate idle connections so I consider it not to be azure specific
Regarding âSystem.Net.ServicePoint.SetTcpKeepAlive(true, 301000, 301000);â
SetTcpKeepAlive is an instance member function
How do I access the correct ServicePoint object?
private void SetupROConnection(int connecttimeout)
{
string uri = coninfo.getROUri();
this.clientChannel = RemObjects.SDK.ClientChannel.ChannelMatchingTargetUri(uri);
this.message = RemObjects.SDK.Message.MessageMatchingTargetUri(uri);
if (message is RemObjects.SDK.BinMessage)
{
((RemObjects.SDK.BinMessage)message).MaxMessageSize = Int32.MaxValue;
((RemObjects.SDK.BinMessage)message).MaxDecompressedMessageSize = Int32.MaxValue;
((RemObjects.SDK.BinMessage)message).UseCompression = true; // FVC: Note: By default true
}
if (this.clientChannel is RemObjects.SDK.IpSuperHttpClientChannel)
{
((RemObjects.SDK.IpSuperHttpClientChannel)this.clientChannel).ConnectTimeout = connecttimeout * 1000;
((RemObjects.SDK.IpSuperHttpClientChannel)this.clientChannel).RequestTimeout = 5*60*1000;
}
if (this.clientChannel is RemObjects.SDK.IpHttpClientChannel)
{
((RemObjects.SDK.IpHttpClientChannel)this.clientChannel).Timeout = 5*60 * 1000; // FVC: To check if this is works
}
if (this.clientChannel is RemObjects.SDK.IpTcpClientChannel)
{
((RemObjects.SDK.IpTcpClientChannel)this.clientChannel).Timeout = 5*60 * 1000; // FVC: To check if this is works
}
}