My biggest problem is spamd and heavy spam attacks. If there's heavy spam volume it also tends to use mysql (whitelist/bayes data in my config is in it) and takes the load up, iotokens down.
My solution has been to use the watchtokens.pl script I have created (see
http://www.kotalampi.com/scripts/watchtokens ). It checks your available tokens and system load and if they reach critical levels (read the script), it runs the script /etc/rc.d/stop.sh and when things are back to normal, it runs /etc/rc.d/start.sh. It also creates stats to /var/adm/watchtokens.$DATE file (that rotates daily) and you can tail -f it to see what is going on.
In my stop.sh I block port 25 and all new connection requests. In start.sh I allow requests again. I have secondary MX so this has worked really well for me. This has proven out to be a good way to throttle the load and avoid iotokens to run totally out.
My stop.sh:
#!/bin/sh
/sbin/iptables -D INPUT -i eth0 -p tcp -m tcp --dport 25 -j ACCEPT
My start.sh:
#!/bin/sh
/sbin/iptables -A INPUT -i eth0 -p tcp -m tcp --dport 25 -j ACCEPT
The script can be started like this:
# /usr/local/bin/watchtokens.pl --sleep=15 --stop=yes &
Sleep option tells you how often you want to check iotokens, stop-option tells if you really want to run stop.sh/start.sh or just log the data.
Cheers,
Risto