View Full Version : Dealing with SMTP performance issues

11-28-2011, 07:10 AM
**** Comments on script

Batch file to try to stabilize SMTP. Idea is to disable features that require more processing when receiving SMTP mail. Under good conditions (fast disk, good dimensioning of server), you should not have SMTP performance issues, so this is a temporary workaround to try to solve problems, but there are no guarantees in using this script, use at your own risk.

Notice that usually the ideal is to analyse the problem and discover the bottleneck. This script is more radical and disables a serios of options. USE WITH EXTREME CARE!

Of course, check if what is occuring is not spam abuse (check your out queue and faqs regarding this at http://esupport.icewarp.com/index.php?/Knowledgebase/Article/View/257/0/securing-your-icewarp-server).

Also compare your installation with a fresh one and settings such as system/advanced.

Other solutions include ram drive for temp (http://www.softperfect.com/products/ramdisk/), faster storage and separating SMTP in/out. Also consider separating accounts/antispam/groupware in a separate DB server if you have over 500 accounts or even less but a lot of traffic.

Don't forget to REENABLE OPTIONS afterwords. Check each of the options that are disabled in the batch file and reenable according to what you had originally enabled using the Icewarp console. To keep it safe, you can consider making a backup of your icewarp/config folder.

Make sure proxy is disabled, unless you really used it. In the console, check Web/Proxy/Security, make sure "require user authentication" is marked, if it isn't, start the proxy, mark it, then stop the proxy. This helps if, by accident, you start the proxy server, it wouldn't be abused.

REM ***** The script

rem copy x paste to a batch file in icewarp root and execute. In case of Linux, replace tool with ./tool.sh

rem disable antispam

tool modify system C_AS_General_Enable 0

rem disable integrated antivirus

tool modify system C_AV_General_IntegratedAV 0

rem disable mail/archive (email archiving)

tool modify system C_System_Logging_General_Archive 0

rem disable account quota calculations

rem to reenable wave mode, change to value 2

tool modify system C_Accounts_Global_Accounts_DirectoryCacheDisable 1

rem disable user statistics calculation when receiving e-mails

tool modify system C_Accounts_Global_Accounts_UserStat 0

rem disable user/domain level quotas

tool modify system C_Accounts_Global_Domains_UseDiskQuota 0
tool modify system C_Accounts_Global_Domains_UseUserLimits 0
tool modify system C_Accounts_Global_Domains_UseDomainLimits 0

rem make sure migration tool (systems/tool/migration) is stopped

tool modify system C_System_Tools_Migration_Active 0

rem disable DNSBLs, rDNS and domain does not exist tests (in mail/security/DNS tab)

tool modify system C_Mail_Security_Protection_DNSBL 0
tool modify system C_Mail_Security_Protection_RejectrDNS 0
tool modify system C_Mail_Security_Protection_RejectMX 0

rem disable content filters and global rules (mail/filters)

tool modify system C_Mail_Filter_Content_Enable 0
tool modify system C_Mail_Filter_BW_Enable 0

rem disable local mda (mail/general/advanced/usa mda queue for internal msg delivery). if problems persist, consider disable normal MDA also.

tool modify system C_Mail_SMTP_Delivery_MDAInternal 0

rem end of batch file

REM ***** Other procedures

- disable all logging in system/logging with shift then choose NONE in drop down menu, easier then via API.

- only if problems persist, disable user level rules tool modify account *@* U_BlackWhiteFilter.

For domain level rules you have to backup filter.dat in config folder, then delete them all (del filter.dat /q /s /f).

- if all fails, try to run:

tool modify system C_Accounts_Global_Accounts_DirectoryCacheLiveUpdat e 0

This disables the live update checking of quota as emails arrive.

Note: for some reason forum is putting a space before the letter E in update, above. remove that space, please :)

Note 2: this shall be unecessary in v10.4 as it will be DB driven.

- If problems persist, Enable SMTP logs in debug mode and performance logs (system/logging/debug) with a value of 5, it will log all actions that take over 5 seconds. Via API (File/API console) set system.log.performance.level to 10 (brutal). Compare the thread of a session that takes long in SMTP with the same thread/time in the performance logs (in status/logs).

Also enable "Mail flow, queue and processing logs". This will log SMTP email reception and all actions that occur, such as content filters, anti-spam, etc. It can help to discover what is causing some delay. Compare the thread of a session that takes long in SMTP with the same thread/time in the queue logs (in status/logs).

All the best,