On Mon, Jun 4, 2012 at 12:36 PM, Brandon Black <[email protected]> wrote: > But you can scale up to more packets/sec handled on a given machine by > doing one thread-per-socket (-per-core) and distributing the packets
I forgot to mention in the previous email: another area to look at for high performance UDP on Linux is the relatively new syscalls sendmmsg() and recvmmsg(). These can send or receive multiple UDP packets in a single syscall. This reduces the syscall overhead (you're bouncing out to kernel space less often and picking/dropping packets in batches), which further improves the performance of looping on a single socket. In theory, it could reduce internal kernel overhead as well (e.g. lock the socket once for all packets), but last I checked a lot of those kernel-internal optimizations haven't yet been implemented; it more less just loops over sendmsg() internally in the kernel. By using this interface you'll get them if they ever are, though. Just killing some syscall overhead for now is still a nice help. -- Brandon _______________________________________________ libev mailing list [email protected] http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
