Network Performance
-
Hi Guys, A have a client/server application using sockets (TCP/IP) for all the IPC needs. I came across a very interesting problem the other day and is still quite stumped by it: When the apps are running on a local pc with the network cable not connected, then the apps run fine and the performance is as expected. However, when the pc is then connected onto the lan the apps suddenly start behaving eratically. They will crash for no reason, or the data transfers between the client and server will become very slow, or timeout and all weird things happen. I then unplug the cable and voila, all is fine again. I have tested lots of other network apps on that same pc and they all seem to work fine. Does anyone have any idea as to what may be wrong or where I can start looking for the problem ? Thanks
-
Hi Guys, A have a client/server application using sockets (TCP/IP) for all the IPC needs. I came across a very interesting problem the other day and is still quite stumped by it: When the apps are running on a local pc with the network cable not connected, then the apps run fine and the performance is as expected. However, when the pc is then connected onto the lan the apps suddenly start behaving eratically. They will crash for no reason, or the data transfers between the client and server will become very slow, or timeout and all weird things happen. I then unplug the cable and voila, all is fine again. I have tested lots of other network apps on that same pc and they all seem to work fine. Does anyone have any idea as to what may be wrong or where I can start looking for the problem ? Thanks
od@ananzi.co.za wrote:
A have a client/server application using sockets (TCP/IP) for all the IPC needs...When the apps are running on a local pc with the network cable not connected, then the apps run fine...
How so? Is your network being saturated with too many packets? Are you using any hubs or switches?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
od@ananzi.co.za wrote:
A have a client/server application using sockets (TCP/IP) for all the IPC needs...When the apps are running on a local pc with the network cable not connected, then the apps run fine...
How so? Is your network being saturated with too many packets? Are you using any hubs or switches?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
I have started debugging the apps when on the network and most of the crashed do occur within the sockets/socket handler classes. The crashes are totally random at this stage ... Is there an easy way to monitor the network for saturation and collissions etc ? (We do not have any measuring hardware) ...
-
Hi Guys, A have a client/server application using sockets (TCP/IP) for all the IPC needs. I came across a very interesting problem the other day and is still quite stumped by it: When the apps are running on a local pc with the network cable not connected, then the apps run fine and the performance is as expected. However, when the pc is then connected onto the lan the apps suddenly start behaving eratically. They will crash for no reason, or the data transfers between the client and server will become very slow, or timeout and all weird things happen. I then unplug the cable and voila, all is fine again. I have tested lots of other network apps on that same pc and they all seem to work fine. Does anyone have any idea as to what may be wrong or where I can start looking for the problem ? Thanks
Try using the loopback address (127.0.0.1), do not use hostnames or computer names. I would also suggest doing stress tests, the crashs you describe should not happen. Perhaps the current implementation can not handle fragmented packets very well. TCP is a stream oriented protocol, which means data does not have to arrive in the same chunk sizes as they are sent away. Hope it helps. :) /M
-
Try using the loopback address (127.0.0.1), do not use hostnames or computer names. I would also suggest doing stress tests, the crashs you describe should not happen. Perhaps the current implementation can not handle fragmented packets very well. TCP is a stream oriented protocol, which means data does not have to arrive in the same chunk sizes as they are sent away. Hope it helps. :) /M
Sorry, forgot to mention. I'm actually connecting to 127.0.0.1 already. I rarely use any hostnames, especially not when the client/server are running on the same pc. I have an application layer running on top of the socket to reassemble the sent data at the receiver end. this layer has not changed over the last two year, so I'm fairly confident that the problem is elsewhere. But where ??
-
Sorry, forgot to mention. I'm actually connecting to 127.0.0.1 already. I rarely use any hostnames, especially not when the client/server are running on the same pc. I have an application layer running on top of the socket to reassemble the sent data at the receiver end. this layer has not changed over the last two year, so I'm fairly confident that the problem is elsewhere. But where ??
What listening port are you using, could it be that incoming LAN traffic not meant for your application is crashing it? Just to make sure bind your listening socket specifically to
127.0.0.1
and not toINADDR_ANY
. In any case, do stress testing to reproduce and isolate the trouble maker. /M