[go-nuts] Re: Go UDP performance

2017-02-21 Thread anupam . kapoor
> "Franke" == Marcus Franke writes:

,[ Franke ]
| an additional note, don't forget to monitor the netstat udp counter on both
| servers.
| 
| % netstat -auns | grep -A 7 "Udp:"
| Udp:
| 9381 packets received
| 0 packets to unknown port received
| 0 packet receive errors
| 1009 packets sent
| 0 receive buffer errors
| 0 send buffer errors
| IgnoredMulti: 1264
| 
| Maybe your client is dropping the packets and it is not your sender.
`
moreover, depending on how your datagrams looks like (src+dst ip, and
src+dst port), kernel might be distributing each rx-queue of your nic to
the same cpu core. perhaps, SO_REUSEPORT can be used to alleviate this ?

--
kind regards
anupam

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Fast ConcurrentCounter without memory sharing

2016-08-16 Thread anupam . kapoor

,
| It would be interesting to know what the potential speedup is.  It
| should be easy enough to write a C program to measure that.  But when
| writing such a program, remember that no real program will simply
| increment a concurrent counter.  The question is not just how much
| speedup you can get from a concurrent counter, but how much it will
| matter to a real program.
`
normally, atomic-increment for uint64_t on x86 are very expensive. so a
simple thing which works is to amortize that cost.

this basically translates to using a per-core uint16_t, and when that
wraps around, just push the values via atomic update to a uint64_t,
which is a global counter.

when this scheme is compared with vanilla atomic-increment of uint64_t,
it turns out to be quite fast (approx. 4-5 times better)

where would you use this : well, if you are mantaining rx/tx stats for a
10g interface, it becomes significant :)

i have tried this with vanilla C not go, so ymmv.

--
kind regards
anupam

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Small complete examples which show the power of Go?

2016-08-15 Thread anupam . kapoor

,
| I always liked Rob Pike's concurrent prime seive:
| https://play.golang.org/p/9U22NfrXeq
`
i think what you are looking for is an elegant paper by doug-mcllroy
called "squinting at power series"

which bring the power of channels etc to stream processing...

--
kind regards
anupam

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.