Note: These tweaks can help servers with performance issues, but keep in mind and do not overlook that it may mask the real problem such as slow DNS, slow storage, slow DBs, poor connectivity, failing hardware, resident AntiVirus, routing issues, QoS/traffic shaping, network protocol scanners, drive indexers, backups running during peak usage, etc.
Slow DNS, Slow Filters, DNSBL RBL:
Use the performance, DNS, and mail flow logs to find delays.
AntiSpam processing can be affected by any slowness in DNS since it uses that to lookup RBLs, DNSBLs.
Filters can also slow down AntiSpam processing, which in turn can slow down SMTP.
Storage should be as fast as possible, preferably raid 10.
Performance is much improved using separate drives/controllers for temp/logs, the archive, and mail.
The mail store is also the default location for the incoming and outgoing queues.
Under System > Storage > Load Balancing > Settings File, it's possible to set custom locations for the incoming and outgoing queues to improve performance further.
Mail > General > Advanced > MDA Queues.
The MDA queue is designed for high load servers to allow them to accept messages quickly and process through filters and antispam later.
The processing can compete with the server's available resources, so it has a smaller thread size by default.
If the server has sufficient RAM (greater than 16GBs), try increasing the "Max number of simultaneous threads" in increments of 5.
System > Advanced > Protocol > Multithreaded DB Access.
The default setting of 20 is sufficient for most servers.
If the performance log shows "waits" related to DB access, this value can be increased in increments of 5 as long as the server has at least 16GBs of RAM.
The server must have access to a fast DB, and the DB server must in good working order.
Server Thread Cache:
System > Services > ~protocol~ > Other > Server Thread Cache.
Rarely are these changed from their default values of 40.
Increase these settings only on very high load servers with at least 32Gb of RAM.
Max incoming connections:
System > Services > ~protocol~ > Other > Maximum Number of incoming connections.
Servers with at least 16gb of RAM can have these values set to 1000 to prevent hitting the limits during peak usage.
The performance log will show "waiting for thread session" relative to the protocol.
AntiSpam and AntiVirus threads:
At times after an upgrade, these threads can be set to unlimited (value of 0).
If the thread is unlimited, then the process can use much of the resources on the server.
AntiSpam > General > Other - default thread pool is 8
AntiVirus > Advanced - default thread pool is 8
Web > General > ~website~ > Options > Keep open HTTP Connections.
Modern internet links and browsers can quickly renegotiate the connections.
Disable the option to allow the server to recycle the web threads more quickly to prevent saturation.
Old Webmail (\html\webmail\old):
Old webmail is no longer supported, and we've removed it from new installs.
It may be present from previous versions.
The old code does not run efficiently on the newer engines and can cause performance issues.
Disable it by renaming the "old" folder.
App Max Threads:
File > API Console > search for "appmaxthreads"
Appmaxthreads is the global web pool.
The default setting is 0 for unlimited.
Small Files Cache:
File > API Console > search for smallfiles
The small files cache loads the contents of the mailbox imap dat files into memory for faster access.
Do not enable in a load-balanced scenario below version 184.108.40.206
220.127.116.11 has invalidation logic for the cache when LB is setup.
GW pdf conversion:
File > API Console > search for pdf
The documentpdfconversion and pdfimageconversion options allow the creation of thumbnails from documents.
A busy server will be under a higher load due to the documents' processing, try disabling the options to increase performance.
File > API Console > search for idledisable
IMAP idle goes back to the days of dialup when clients had difficulty renegotiating connections.
Modern internet connections are fast enough so renegotiations go unnoticed.
Disable IMAP idle to allow the server to free up connections/network sockets faster to prevent the port's saturation.
File > API Console > search for wcs
WCS calculates and sends usage statistics for webclient.
Disable the option to reduce the load on servers, especially those with many web users.
File > API Console > search for transactions
A transaction is a series of queries performed in one session.
The busier the server, the longer the session, and the slower to process.
The directorycachedontusetransactions and useraccessdontusetransactions allow individual queries to the DB and can be used against a fast DB server.
GW whitelisting address books:
AntiSpam > Whitelist > Whitelist Senders in GroupWare Address books.
This option queries the GroupWare database for contacts during the AntiSpam whitelist check.
A slow DB can result in slow responses and, in turn, slows down the AntiSpam processing.
It also results in more load on the DBs, try disabling the option to improve performance.
Tcmalloc is a newer memory manager and not the default. Consider it experimental.
It should allow better performance, especially on newer multicore processors.
To use the new memory manager, copy icewarp/lib/win64/libtcmalloc_minimal_64.dll to icewarp/
Restart the services.
ulimit (Linux) :
Ulimits can affect the performance of any mail/webserver.
Since Linux treats everything as a filehandle, the network sockets and the back-end processes can easily surpass the limits set.
Verify the limits on the IceWarp server and the DB server.
The following articles describe setting the limits:
for systemd also check /usr/lib/systemd/system/mysqld.service > LimitNOFILE
Commands to create utf8 databases
create database icewarp_accounts DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
create database icewarp_antispam DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
create database icewarp_groupware DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
create database icewarp_dircache DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
create database icewarp_webcache DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
create database icewarp_activesync DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
create database icewarp_reports DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
Open the IceWarp console, go to File> API Console, search for mysqldefaultcharset, and set it to utf8.
Commands to create utf8mb4 databases
create database icewarp_accounts DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
create database icewarp_antispam DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
create database icewarp_groupware DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
create database icewarp_dircache DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
create database icewarp_webcache DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
create database icewarp_activesync DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
create database icewarp_reports DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
Open the IceWarp console, go to File > API Console, search for mysqldefaultcharset, and set it to utf8mb4.
Permissions can be granted for ALL but must have at least the following.
Select table data | Insert table data | Update table data | Delete table data | Create tables | Drop tables | Manage indexes | Alter tables | Reference operations
Allow MySQL user remote access:
GRANT ALL PRIVILEGES ON *.* TO 'user' @ '%' IDENTIFIED BY 'password' WITH GRANT OPTION;
Save a copy of the MySQL config file then edit it as follows:
The default location of the File is C:\ProgramData\MySQL\MySQL Server *version*\my.ini
(Linux - /etc/my.cnf)
The settings below may or may not be present, depending on the SQL version.
Change max_connections from 151 to 1000
Change query_cache_size from 1M to 10M
Change thread_cache_size from 10 to 40
The buffer pool needs to be large enough to hold the working set, at least 1GB or more, especially if the WebClient DB is also on MySQL.
Check the data files' size and round up to the next gigabyte, maybe add another for future growth.
To set the buffer pool to 1GB, change the line innodb_buffer_pool_size=8M in my.ini to innodb_buffer_pool_size=1G and restart MySQL.
MySQL 8 Tweaks:
lower_case_table_names=1 (on linux, must be set before starting mysql the first time).
run the following query for the DB user.
alter user 'user' @ 'localhost' identified with mysql_native_password by 'userspassword';
(localhost option can be % or an IP, depending on if MySQL is allowing remote connections)
If alter does not work on the specific version of MySQL 8, try the following:
CREATE USER 'user' @' %' IDENTIFIED with mysql_native_password by 'userspassword';
GRANT ALL PRIVILEGES ON *.* TO 'user' @ '%' WITH GRANT OPTION;
Save a copy of \config\webserver.dat
Edit the file and verify set the following:
fcgi_initservers 50 to 100
fcgi_threadpool 50 to 100
activesync threadpool -1
Note: set fcgi_initservers and fcgi_threadpool to the same value.
Use a separate MySQL server with MySQL set to 80% ram usage.
Increase the ram on the IW server to at least 32g.
Set WEB, IMAP, GW incoming connections to 4000
Enable tcmalloc (remember to copy new tcmalloc after any upgrades)
Use binary imapindex for large mailboxes-
-set c_system_services_imap_indexstorage to 2
-create \config\imapbinary.dat with one email address per line