linux - when using TCP for local IPC, loopback shortcut doesn't work on OSX for IPv6 addresses -
i'm using tcp sockets local ipc between applications running on same machine.
the data exchanged in ipc simple: client sends 4-byte request, server sends 128kb response, happens in tight loop.
now if open connection 127.0.0.1 or ::1, expected shortcut through loopback, described in this question , delay low.
if open connection 192.168.0.2 (the local v4 address of machine), same thing happens. network stack seems smart enough detect it's same machine , latency low.
now if open connection of global v6 addresses of machine (doesn't matter if temporary or not), latency increases immensely if i'm on osx (10.11.3), not on linux. seems linux smart enough detect using loopback , speeds things up, while osx can't v6 address.
to summarise:
- 127.0.0.1: fast everywhere
- local v4 address: fast everywhere
- local v6 address: fast on linux, slow on osx
is known defect of osx, or linux doing shouldn't doing?
edit: not make difference whether use tcp_nodelay option or not.
Comments
Post a Comment