Page 1 of 1

About tcpNoDelay issue

Posted: 12 Mar 2013, 04:23
by nekokiller
Hi~ I want to ask something about tcpNoDelay issue.

I have read some posts about tcpNoDelay issue in this forums.
I know that we can set the tcpNoDelay option to be true in core.xml.

My question is, is that option only affact the packets server send to client ? or affact both client and server side ?
If it is affact the server side only, can we set or get the tcpNoDelay option from smart fox client side ?
I just want to know what is the default value about tcpNoDelay option on client side.

Thanks.

Re: About tcpNoDelay issue

Posted: 12 Mar 2013, 16:20
by Lapo
The settings on the server side affects only the server side.
In general the TCP NO DELAY options is a good optimization and we haven't seen many advantages in turning it off, unless there's some very specific case.

Re: About tcpNoDelay issue

Posted: 13 Mar 2013, 01:14
by nekokiller
Thank you, but I'm not sure what you mean.

Do you mean tcp no delay options on client side is already turn on ?

We want to make sure the tcp no delay option is really turn ON on the client side.

Because our customer doubt us have not turn it on. They want me to show or prove it is turn on.

Re: About tcpNoDelay issue

Posted: 13 Mar 2013, 08:58
by Lapo
No, the API don't turn on the TCP_NO_DELAY.
Why do you need to turn it on? What is the advantage?

Re: About tcpNoDelay issue

Posted: 13 Mar 2013, 23:36
by nekokiller
Yes, That's my question, too. What is the advantage , is it really help to reduce the response time of extension reqeust? ( Because our project is a real time game )

To figure out this question, we need to do some experiment about TCP_NO_DELAY option . Do some testing with turning on the TCP_NO_DELAY from smartfox client.

Our customer, they believe that turn on the TCP_NO_DELAY can help their real time game networking ( In China, the network environment is very complex)
And they always turn on that option in their own project. ( turn on means: TCP_NO_DELAY is true, Nagling is disabled. )

In this reference : http://en.wikipedia.org/wiki/Nagle's_algorithm
you can see TCP_NODELAY interactions with real-time systems...
" For this reason applications with low-bandwidth time-sensitive transmissions typically use TCP_NODELAY to bypass the Nagle delay ... "


So, could you provide a api to set/get the TCP_NO_DELAY option and just let me to do some testing and report to you ?

Re: About tcpNoDelay issue

Posted: 14 Mar 2013, 10:05
by Lapo
nekokiller wrote:Yes, That's my question, too. What is the advantage , is it really help to reduce the response time of extension reqeust? ( Because our project is a real time game )

To figure out this question, we need to do some experiment about TCP_NO_DELAY option . Do some testing with turning on the TCP_NO_DELAY from smartfox client.
We have already done these experiments and the answer is no, it doesn't help the performance.
The TCP protocol is much smarter at optimizing the data, it has many ways of doing it and what really changes the user experience is just one parameter: a good connection :)

If the user connection sucks, there's no TCP flag that can counterbalance the situation.
Our customer, they believe that turn on the TCP_NO_DELAY can help their real time game networking ( In China, the network environment is very complex)
It won't, believe me. We have addressed this problem dozens of times and there's no significant change, often times I've seen things going even worse, because packets are not aggregated and they end up overwhelming the client.

There's a physical limit of 12-15 packets per second over TCP/IP, if you need a higher packet rate the only solution is to use UDP instead and make sure that your code is resilient to packet loss.

Hope it helps

Re: About tcpNoDelay issue

Posted: 14 Mar 2013, 10:37
by nekokiller
OK~ I got it.
Thank you so much. :)