- This topic has 4 replies, 2 voices, and was last updated 8 years, 8 months ago by Anonymous.
October 24, 2013 at 19:31 #1137AnonymousInactive
We are currently testing this library and are running some performance tests against it.
When using the SendReceiveObject in either of the following 2 statements it appears to be using compression on the data transfer streams. The reason we are looking into this is that performance for these types of transfers (40/sec) is getting crushed compared to regular SendObject calls (10,000 per sec). Doing performance analysis on it and it is spending 95% of its time in compression routines.October 24, 2013 at 20:00 #1138AnonymousInactive
Upon further investigation the client is not compressing it is on the return from the server that it is compressing. We are passing in the same connection options for both the send and receive. But looks like in the server side that the information is lost. Here are relevant code parts:
SendReceiveOptions ProtoOnly = new SendReceiveOptions (DPSManager.GetDataSerializer<ProtobufSerializer>(),null,null );
mst = server.SendReceiveObject<MsgSimpleText>(“SimpleIntReturnScenario”, “SimpleIntReturnType”, 2500, msi,ProtoOnly ,ProtoOnly );
private static void HandleSimpleIntReturn(PacketHeader header, Connection connection, MsgSimpleInt msi)
//Thread.Sleep(4000); // Test timeout situation.
MsgSimpleText mst = new MsgSimpleText();
mst.Text = “The value you sent was: ” + msi.Number.ToString();
Console.WriteLine(“SimpleInt Value was: ” + msi.Number.ToString() + ” sending a SimpleText Object back”);
connection.SendObject(“SimpleIntReturnType”, mst,connection.ConnectionDefaultSendReceiveOptions );
I see the AppendGlobalIncomingPacketHandler allows for a server options object. But how does it get it from the client request?October 25, 2013 at 02:39 #1140AnonymousInactive
But, If I hard code the server side, I can get both sides to use non-compressed data transfers and the get the transactions/second into the thousands range. So I have a work around for this, but it seems that it should be able to bet set from the client and the server would adhere to it…October 25, 2013 at 13:51 #1141AnonymousInactive
The answer was easy. Once it was found!
On the server side (and can do same on client side) you can access the static object – NetworkComms. It contains application wide settings and defaults. Not shown anywhere in tutorials or documentation, but it works. So:
SendReceiveOptions nullCompressionSRO = new SendReceiveOptions(DPSManager.GetDataSerializer<ProtobufSerializer>(),null,null);
NetworkComms.DefaultSendReceiveOptions = nullCompressionSRO;October 25, 2013 at 14:59 #1142AnonymousInactive
Glad you found a solution. The connection settings are only applied to the single connection endpoint, not both. This allows for more flexible configurations.
- You must be logged in to reply to this topic.