> Is memory usage on insertion a real problem or only a theoretical? If > message size is limited to 25 MB by the MTA and the MTA is only allowed > to deliver 25 messages at once maximum memory usage is 625 MB. But I > think it happens very rarely that 25 mails with the maximum message size > arrive at once and are inserted at once.
Well, it is a theoretical problem atleast. We host something like 15.000 domains each with loads of mailaccounts. We generally peak at 300 incoming mails per minute, not counting spam-floods and viruses. We currently allow 50MB max mail size, but might want to increase that at some point in the future. So I can see perfectly well that memory usage can peak way above what we have of physical ram. And when it runs out of memory it needs to swap, and that leads to reduced performance. Reduced performance might mean we can't handle all the incoming mails as they arrive, thus building up huge queues that also decrease performance. It can lead to OOM conditions or even a total system crash. System crashes make the alarm go off and wake me at night, leading to a pissed off sysadmin. I'd rather have the usage of tempfiles _IF_ the size of a mail goes above a specified threshold. This should lead to a minimal performance decrease if done right. -HK