ngmoco/falcore — pull request #49 by smw1218 (2013-04-22 23:35:04+00:00)
Title: Set the socket back to nonblock

when go makes a blocking syscall, it does it in a thread so the main process isn't blocked. calling File() on the socket sets it to blocking (I don't know why goteam did that). So every read/write to that socket causes threads to be spawned. Under heavy load I was leaking threads badly and each sucks up 8M of virtual memory.

this patch works, but I think we should consider pulling the TCPCORK out of falcore entirely. I think it's more likely that we will end up interfering with go's internal optimizations rather than reaping the benefits of messing with the socket params.