fortio icon indicating copy to clipboard operation
fortio copied to clipboard

TIME_WAIT socket leftover on macos when using self fetch (new socket each time)

Open ldemailly opened this issue 8 years ago • 1 comments

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

ldemailly avatar Mar 04 '18 12:03 ldemailly

see also http://www.serverframework.com/asynchronousevents/2011/01/time-wait-and-its-design-implications-for-protocols-and-scalable-servers.html

ldemailly avatar Mar 04 '18 12:03 ldemailly