Howard Chu wrote:
A. Schulze wrote:
Howard Chu:
Any idea why the memory usage is so different?
If the only difference is that you set the open file limit to 1024, then it sounds like whatever your default file limit is is much larger.
Hello Howard,
yes, it's unlimited by default. Tons of other daemon also run without this limits here.
But in contrast: all other daemons don't let explode the memory usage. Maybe, it worth to find the difference?
That *is* the difference. slapd allocates an array of connection info, one slot per file descriptor. Running with "unlimited" files is clearly a bad idea here.
In general, running with larger limits than you actually need is a bad idea. This is elementary system administration.
Couldn't one s/running with larger limits/consuming more resources/ and s/system administration/software development/ and produce an equally valid argument though? (If anything, larger-than-necessary limits seem the more justifiable of the two to me -- it allows for future growth, which can be hard to predict.)
More to the crux of the matter: why does slapd need to preallocate all OPEN_MAX possible connection info records at once instead of dynamically as connections are actually created?
I've actually been bitten by the inverse problem when slapd ran up against my distro's default FD limit (causing no small amount of grief to the various client systems on my network). I of course remedied this by cranking up said limit a fair amount, but the number I chose was basically just a hand-wavy, seat-of-the-pants guess at something that would last a while before I had to tweak it again, and thus means that slapd's going to be sitting on significantly more memory than it really needs.
So as an administrator I'm left with the question of how to balance slapd's file descriptor requirements against my desire to not have it tying up a bunch of memory it's never actually going to use. It seems like that balancing act would be a lot easier if slapd could dynamically allocate memory for connections.
Zev Weiss
(Apologies for any strangeness with the formatting/headers of this message; I wasn't subscribed to the list when the message quoted above was sent and hence have sort of manually synthesized this reply via copy/paste from the mailman web archive.)