fortio
fortio copied to clipboard
TIME_WAIT socket leftover on macos when using self fetch (new socket each time)
url: [::1]:8080/fortio/fetch/[::1]:8080/echo
qps 400; 24 connections; 3s
Sockets used: 1224 (for perfect keepalive, would be 24) Code 200 : 1200 (100.0 %) All done 1200 calls 10.504 ms avg, 397.5 qps
$ netstat -na -f inet6|grep 8080|grep TIME |wc -l 1248
or with 4000 calls and 10 connections at 400qps: Sockets used: 4000 (for perfect keepalive, would be 10) $ netstat -na -f inet6|grep 8080|grep TIME |wc -l 4010
to consider SetLinger()
strangely this seems MacOS only
see also http://www.serverframework.com/asynchronousevents/2011/01/time-wait-and-its-design-implications-for-protocols-and-scalable-servers.html