[Haskell-cafe] Exceeding OS limits for simultaneous socketconnections

Donn Cave donn at avvanta.com
Mon Jan 30 18:53:52 CET 2012


Quoth Marc Weber <marco-oweber at gmx.de>,
...
> - replace getContents conn by something strict and close the handle
>   yourself? (not sure about this.)

That's an easy one to try, right?  Just force evaluation of the
getContents return value, in getMsg.  If lazy I/O is the culprit
here, it wouldn't be the first time.

But that will only reduce the magnitude of the problem (albeit perhaps
vastly reduce), and as you say, the more reliable solution is to limit
the number of concurrent accepts, and concurrent open-and-sends.  It
isn't like socket I/O really benefits from unlimited concurrency, as all
the data is still serially pushed through a wire; you just need enough
concurrent peer connections to keep the interface busy.

	Donn



More information about the Haskell-Cafe mailing list