Topic: How can I limit required System resources?
==== Required information ====
- iRedMail version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Linux/BSD distribution name and version:
- Related log if you're reporting an issue:
====
On a VPS I installed iRedMail 0.8.4 on top of Debian Wheezy. I use MariaDB(MySQL) as a backend. I started on a VPS with 512 MB memory. Everything installed and it worked, but was a bit slow. Also some issue arose as RAM was tight. MariaDB did not always start when the server was rebooted due to RAM limitation. OK. I upgraded to 1 GB RAM. But now I still have a resource hungry setup.
ClamD is a hungry beast. But it makes me wonder considering I have limited requirements: just a few users and a handful of domains. All with very low traffic. Looking at top shows:
%Cpu(s): 0.0 us, 0.3 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 1027072 total, 815588 used, 211484 free, 12496 buffers
KiB Swap: 0 total, 0 used, 0 free, 209504 cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2660 clamav 20 0 268m 213m 5408 S 0.0 21.3 1:22.79 clamd
14907 mysql 20 0 820m 101m 8528 S 0.0 10.1 0:00.44 mysqld
2262 amavis 20 0 218m 92m 1116 S 0.0 9.2 0:03.73 /usr/sbin/amavi
2657 amavis 20 0 220m 91m 608 S 0.0 9.1 0:00.00 /usr/sbin/amavi
2658 amavis 20 0 220m 91m 608 S 0.0 9.1 0:00.00 /usr/sbin/amavi
4200 cluebrin 20 0 106m 18m 1468 S 0.0 1.9 0:00.00 cbpolicyd
4201 cluebrin 20 0 106m 18m 1364 S 0.0 1.9 0:00.00 cbpolicyd
4202 cluebrin 20 0 106m 18m 1364 S 0.0 1.9 0:00.00 cbpolicyd
4203 cluebrin 20 0 106m 18m 1364 S 0.0 1.9 0:00.00 cbpolicyd
4181 cluebrin 20 0 78988 17m 956 S 0.0 1.7 0:03.32 cbpolicyd
9491 www-data 20 0 246m 9.9m 792 S 0.0 1.0 0:00.14 apache2
9521 www-data 20 0 246m 9.9m 788 S 0.0 1.0 0:00.54 apache2
9327 www-data 20 0 246m 9.8m 772 S 0.0 1.0 0:00.27 apache2
9617 www-data 20 0 246m 9916 736 S 0.0 1.0 0:00.01 apache2
4802 iredadmi 20 0 373m 9756 556 S 0.0 0.9 0:06.27 apache2
9622 www-data 20 0 246m 9744 584 S 0.0 0.9 0:00.01 apache2
4781 root 20 0 244m 9544 2496 S 0.0 0.9 0:06.75 apache2
2884 root 20 0 113m 7600 1400 S 0.0 0.7 1:30.54 fail2ban-server
Considering a limited number of (occasional) users and low traffic: can I limit the number of process spawns of amavis and cbpolicy?
Can ClamD be maintained memory wise? Or even replaced by a less resource hungry variety
After playing around with the configuration of the installed components I noticed that limiting for instance amavis in master.cf by reducing it to 1 process and changing max_use from 20 to 10 it still ends up at 100 and still multiple spawns take place. So I assume this is managed elsewhere. Is this documented somewhere?
I noticed that 512MB or 1GB does not matter that much: all daemons eat up about the same percentage of RAM. Some people reported to have Iredmail running on as low as 256mb RAM servers.
To sum up:
Is there any documentation available on how to tweak Iredmail and it's associated components or can you provide any hints/tips on how to commence?
In my current setup I need a full VPS just for mail and cannot use it for other stuff unless I part with extra cash doubling costs. It would be great if about 30-40% RAM could be freed for other stuff.
Any hints appreciated!
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.