Hello,

I need to distribute about 100Mbit data stream among several applications
locally.
So I have decided to use UDP multicats on loopback interface.
In general this works except the data loss.
So I have created simple sending and receiving app.

https://gist.github.com/xdenser/73f33f6728e6de6fd10d

In variant presented in gist it shows maximum data rate for me around
500 Mb/s or 4GB/s (should not it be bigger?)
on 1st gen Intel i5 CPU 650 at 3.2Ghz under Win 7

What is strange:
1. When i start only sending part it shows numbers around 900Mb/s
After that when I start receiving part sending rate drops to ~500Mb/s.
And in general starting receiving part always drops sending part
rate.Except one case.
2. Receiving part always shows lower numbers than sendig, except that one
case. This is when data are lost.
3. I tried to wrap sending callback in process.nextTick, sendImmediate and
setTimeout.
process.nextTick and setImmediate give slightly lower rates than original
variant and data are lost too I see no other difference, setTimeout gives
rate bout 4Mb/s w/o data loss - i.e. sending and receiving parts show same
numbers.
4. I tried smaller buffer size - the result is the same (with lower rates).

So the question is how to prevent data loss with higher rates? It is
obvious that it is packet sending frequency matters. But there is no way to
ensure packet will be received on receiving end (except very low
frequency). Using ack packets? Or maybe some special settings?

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAP8%3DUyR1ZB3j61dJAXucyh8craQXshrWs3uBW_UrhmSy%3DOsC6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to