[Mimedefang] too few slaves *and* too many open files = __FD_SETSIZE woes

David F. Skoll dfs at roaringpenguin.com
Wed Oct 29 09:53:54 EDT 2008


Steven Winikoff wrote:

> So why not just increase the file descriptor limit?

> Because this is on Linux, so even if we do increase it beyond the
> default value of 1024, we still run into the __FD_SETSIZE limit of
> 1024 descriptors, and I haven't found a way to increase that.

Yeah, this is annoying.  I can think of two possible workarounds:

1) Compile libmilter to use poll() instead of select().  I believe you
can do that by defining the SM_CONF_POLL macro when compiling libmilter.

The multiplexor itself will still use select(), but it's usually the milter
process that runs out of file descriptors, not the multiplexor.

2) Invoke "mimedefang" with the "-C" option; this makes it conserve file
descriptors by closing and reopening files instead of keeping them open
across milter calls.  This may help a bit, and doesn't require recompiling.

and a third "workaround" that avoids the problem:

3) Run multiple scanning machines (either real or virtual) so you can
scale horizontally and avoid the whole mess, rather than using one or a
few massive machines.

Regards,

David.



More information about the MIMEDefang mailing list