SA Bugzilla – Bug 241
SA-2.20 (official) dies with "-D" disabled
Last modified: 2002-04-21 15:19:32 UTC
I just installed SA-2.20, and threw a few messages I had through it to test that it worked. I run it as: spamd -i 0.0.0.0 -A 127.0.0.1,155.63.248.198 -F 1 -L -x -u spamc -m 10 On some messages, it's fine, on others (looks like messages with attachments) spamd logs via syslog the connection from spamc, but no action. And the message has no headers added. This is irrespective of whether or not the message is spam or not. If I add "-D" to the end of that, and run it manually, then all messages are marked correctly. It looks like "-D" is needed for some output senarios?
Gah - me bad. It's a memory problem. I've been running SA-2.20 from CVS for some time, but it looks like there's large memory requirments when dealing with mail with attachments? I run spamd under daemontools with a 10Mb RAM limit. Running it with "-D" was a red-hearing - it was running it with no resource limit that fixed it. Should SA use so much RAM? Shouldn't it be using a moving-window to minimize memory usage?
I suspect what you're seeing is the spamc default of setting "-s 250000" -- in other words, messages longer than 250k won't get processed by spamd under default settings. Messages with attachments tend to be the ones that are >250k. Because of a curiosity in the way the message is processed, spamc will in fact open a connection to spamd, but then once it realizes the message is >250k, it'll just close the connection again, hence spamd logs a connection being opened, but never mentions receiving an actual message. Go ahead and re-open if it turns out this isn't the answer.
No - it's not a "-s" issue. All messages are < 100K, and they're processed fine when I upped the softlimit on the amount of RAM spamd could use. It's simply that something in SA must be creating a large array or variable containing the content of the message or the like. I had a softlimit of 10M set for spamd - such messages needed around 12Mb RAM... There must have been new tests added to SA that have pushed it's memory requirements up by a couple of megs. BTW, if I had 3 such messages coming in simultaneously, would that be 12x3 MB RAM or just 12Mb + a bit? This is probably an issue that should be documented as if an ISP is wanting to process >20 messages at a time via spamd, and a proportion of them are swallowing largish chunks of RAM, then the system may become unstable. I'm recommending everyone run spamd under softlimits/ulimits just as Qmail runs qmail-smtpd: it stops unstable conditions from occurring.
You should have mentioned you limited SA with a softlimit. It's not crashing on it's own, it's being killed by the OS! In answer to the question on whether it will be 12 Mb per message or 12 MB + a little bit, it'll depend on your OS. Most modern OSes will be 12 + a bit. Though each process will show up in the process table as having 12 MB, most of the memory will be shared through copy-on-write stuff.