Home All Groups Group Topic Archive Search About

How to boost network utilization with Socket/TcpClient (.NET 1.1)

Author
30 Aug 2006 4:56 AM
Thana N.
Hi,

I've developed program to sending Serializable message (using Attribute)
with BinaryFormatter.  But it can use Network utilization only 6% on 100Mbps
LAN (check from Networking on TaskManager).  The program is service guarantee
model that send the message and wait for ack message before sending next
message.  Another point is that program will receive messages from clients
and then queue them to send thread to send those messages to another machine.
And my test environment is on XP box with HT machine.

So, how can I do to improve the performance that will not affect design goal?

Thanks in advance,
Thana N.

Author
30 Aug 2006 8:50 AM
Vadym Stetsyak
Hello, Thana!

TN> I've developed program to sending Serializable message (using
TN> Attribute) with BinaryFormatter.  But it can use Network utilization
TN> only 6% on 100Mbps LAN (check from Networking on TaskManager).  The
TN> program is service guarantee model that send the message and wait for
TN> ack message before sending next message.  Another point is that program
TN> will receive messages from clients and then queue them to send thread
TN> to send those messages to another machine. And my test environment is
TN> on XP box with HT machine.

If your serialized messages are relatively small, then you can set
SocketOptionName.NoDelay to disable possible Nagling.

Also consider the fact that processing not related to Network I/O
( message serialization/deserialization ) can take some time...

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Author
31 Aug 2006 3:02 AM
Thana N.
My program has also enable it, but its result as I've told before.  Here,
anyway, is my code for that (if I do it wrong):-

clientSock.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, 1)

Thanks for your reply,
Thana N.

Show quote
"Vadym Stetsyak" wrote:

> Hello, Thana!
>
>  TN> I've developed program to sending Serializable message (using
>  TN> Attribute) with BinaryFormatter.  But it can use Network utilization
>  TN> only 6% on 100Mbps LAN (check from Networking on TaskManager).  The
>  TN> program is service guarantee model that send the message and wait for
>  TN> ack message before sending next message.  Another point is that program
>  TN> will receive messages from clients and then queue them to send thread
>  TN> to send those messages to another machine. And my test environment is
>  TN> on XP box with HT machine.
>
> If your serialized messages are relatively small, then you can set
> SocketOptionName.NoDelay to disable possible Nagling.
>
> Also consider the fact that processing not related to Network I/O
> ( message serialization/deserialization ) can take some time...
>
> --
> Regards, Vadym Stetsyak
> www: http://vadmyst.blogspot
Author
31 Aug 2006 7:00 AM
Vadym Stetsyak
Hello, Thana!

Another option for you is to send mutltiple messages at once and receive one confirmation for them all.
I suppose that you have somekind of message id. This ids can be used in confirmation.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Author
31 Aug 2006 9:04 AM
Thana N.
Vadym,

Oh, I've forgot to tell you that message sequence is important for my case. 
So I can't send multiple messages at once.

Sorry for your inconvenience.
Thana N.

Show quote
"Vadym Stetsyak" wrote:

> Hello, Thana!
>
> Another option for you is to send mutltiple messages at once and receive one confirmation for them all.
> I suppose that you have somekind of message id. This ids can be used in confirmation.
>
> --
> Regards, Vadym Stetsyak
> www: http://vadmyst.blogspot
Author
31 Aug 2006 7:27 PM
Vadym Stetsyak
Hello, Thana!
You wrote  on Thu, 31 Aug 2006 02:04:02 -0700:

TN> Oh, I've forgot to tell you that message sequence is important for my
TN> case.  So I can't send multiple messages at once.

Then it seems to me that your processing logic introduces some latency, that
is why network is not fully utilized...

--
Regards, Vadym Stetsyak.
Blog: http://vadmyst.blogspot.com
Author
1 Sep 2006 8:07 PM
Ben Voigt
"Thana N." <Tha***@discussions.microsoft.com> wrote in message
news:8029CA44-6524-4B93-AB38-C71391288B44@microsoft.com...
> Vadym,
>
> Oh, I've forgot to tell you that message sequence is important for my
> case.
> So I can't send multiple messages at once.
>
http://www.google.com/search?hl=en&q=%22Stop+and+Wait%22&btnG=Google+Search

AddThis Social Bookmark Button