How to prevent saslauthd sucking up memory

For about a year I noticed that very infrequently my VPS would run out of memory.. at first I thought it was probably just a wordpress plugin, but after a while I discovered it was actually saslauthd. This is a known bug (not known very well though..) with saslauthd on Debian. Anyway, here’s the fix – I’m not totally sure of the implications, so if you run a busy mail server I’d recommend you look into it a bit more before doing it:

I changed this line:

Update the file: /etc/default/saslauthd

OPTIONS=”-c -m /var/run/saslauthd”

to:

OPTIONS=”-c -m /var/spool/postfix/var/run/saslauthd -r”

I think this basically disables threading and enables forking of the process (or something like that) which is what was responsible for the memory leak.

So if you’re running out memory on your server, maybe give this a try 🙂

[Thanks to Djamu: http://www.howtoforge.com/forums/archive/index.php/t-52750.html ]

4 thoughts on “How to prevent saslauthd sucking up memory

  1. You’re wrong

    What makes saslauthd not opening threads are “-n 0” parameter

    So you have to change default

    OPTIONS=”-c -m /var/spool/postfix/var/run/saslauthd -r”

    by

    OPTIONS=”-n0 -c -m /var/spool/postfix/var/run/saslauthd -r”

    As said in the howtoforge link you provide.

  2. Or, even better

    Don’t touch the “OPTIONS” line, and change:

    THREADS=5

    by

    THREADS=0

    in the same file

    🙂

Leave a Reply

Your email address will not be published. Required fields are marked *