LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading of 789 bytes TCP I/P is very slow

I'm implementing a server.  In the server implementation I know how many bytes I have on the TCP I/P connection.  I use the TCP I/P read function with the bytes specified and it takes around 2 seconds to read the 789 bytes.  I'm wondering why that is the case?
0 Kudos
Message 1 of 3
(2,544 Views)
I haven't seen slowness like that.  I would try doing the TCP read in "immediate" mode and see how it behaves.  That means as soon as any packet comes in, you'll get all its data.  

You could also check whether your DNS is slow, in case your are using machine names rather than IP addresses.

Jason Dunham
0 Kudos
Message 2 of 3
(2,539 Views)

THere could be a number of reasons...

If you are opening sending and closing for each packet, then that is good performance since there is alot of things happening to establish the connection etc.

If you keep the connection open and using it to repeatedly send the packets, then you may be seeing poor network performance due to collisions on the network or you are running into the "Naegel algorithm" (Ialways spell that wrong) which attempts to optimize network traffic by collecting many small packets and sending them as one large packet. This can be tested be changing the size of your test such that you are sending "extra" data. For some reason I remeber 1500 as an optimal size.

And YES DNS will slow down the initial connection time.

I hope that helps,

Ben

Message Edited by Ben on 08-30-2007 01:50 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 3
(2,539 Views)