1

Topic: Hardware requirements

======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.8.5
- Linux/BSD distribution name and version: CentOS 6.9
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro?: Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I'm planning to move about 2000 users to a new server. The current server has 24 GB of RAM, but it can't handle running Amavis as the I/O kills the server, or more correctly, Postfix can't keep up and the mail queue grows and grows until I disable Amavis. The only reason I'm using that much RAM though is because, until recently, it was the only way for me to get enough disk space. Without Amavis 8 GB is enough. If you were to look at some of my posts from a few years ago you'll see that I tried just about everything to get Amavis to run, including https://docs.iredmail.org/disable.spam. … mails.html .

This guy ( https://forum.iredmail.org/topic8655-us … users.html ) runs with Amavis and less RAM than I currently do and almost ten times as many users.

I plan to do a fresh installation on the new server and follow *every* suggestion to fine-tune performance. I'm talking with the data centre about needing a high I/O machine, but I'm still worried that it won't be enough.

My question: Is my situation *that* unique? What's unique about it?


Craig

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Hardware requirements

Check this tutorial:
https://docs.iredmail.org/concurrent.processing.html

I wonder:

*) which number do you set in both Postfix and Amavisd.
*) How many (approx) emails did you sent / received every day?

3

Re: Hardware requirements

ZhangHuangbin wrote:

Check this tutorial:
https://docs.iredmail.org/concurrent.processing.html

I wonder:

*) which number do you set in both Postfix and Amavisd.
*) How many (approx) emails did you sent / received every day?

Hi Zhang,

Thanks for your reply. Yes, I believe you pointed me to that documentation a few years ago, and I followed it at that time. Both numbers are 10 in my Amavisd and Postfix configuration files.

I don't have an authoritative number to give you for the number of emails sent and received per day. However, taking a quick look at Logwatch for last week and averaging some numbers, I would say about 24 000 emails a day.


Craig

4

Re: Hardware requirements

craig wrote:

However, taking a quick look at Logwatch for last week and averaging some numbers, I would say about 24 000 emails a day.

Actually, I just took a look at some server activity graphs and I'd say that the 24 000 estimate is probably on the low side due to the fact that a lot of users may have extended a long weekend and took a couple more days off. I'd put it closer to 30 000.

And keep in mind that when I had my problems a few years ago that number was probably much lower.

5

Re: Hardware requirements

Clarification question: If my primary drive was an SSD and my mail store was on an HDD -- fast (high I/O performance) and slow (low I/O performance) for the purpose of this question -- would that be work? Or would the "slow" HDD be a bottleneck?

Thanks.


Craig

6

Re: Hardware requirements

craig wrote:

Thanks for your reply. Yes, I believe you pointed me to that documentation a few years ago, and I followed it at that time. Both numbers are 10 in my Amavisd and Postfix configuration files.

You better set a number which matches the RAM you have. If you want to process more emails but you have just 2GB RAM, it's likely Amavisd + ClamAV will stop working due to no enough memory.

So the question is: how much RAM (and CPU) does this server have?

craig wrote:

Clarification question: If my primary drive was an SSD and my mail store was on an HDD -- fast (high I/O performance) and slow (low I/O performance) for the purpose of this question -- would that be work? Or would the "slow" HDD be a bottleneck?

*) Amavisd extracts message to its HOME directory (set in Amavisd config file, parameter $MYHOME), then call SA/ClamAV to scan it. So this directory should be put on SSD for best performance.
*) Obviously, mailboxes should be put on SSD, because this is a mail server, all services are working with the mailboxes.

7

Re: Hardware requirements

ZhangHuangbin wrote:

So the question is: how much RAM (and CPU) does this server have?

As mentioned in my original post, the server I'm currently using has 24 GB of RAM. It has 8 cores.

ZhangHuangbin wrote:

*) Amavisd extracts message to its HOME directory (set in Amavisd config file, parameter $MYHOME), then call SA/ClamAV to scan it. So this directory should be put on SSD for best performance.
*) Obviously, mailboxes should be put on SSD, because this is a mail server, all services are working with the mailboxes.

OK, I thought that would probably be the case. Was just exploring hardware configuration options.

Any comment on 30 000 emails a day?

Thanks.

8

Re: Hardware requirements

craig wrote:

Both numbers are 10 in my Amavisd and Postfix configuration files.

With 24GB RAM, 8 cores, you can try to increase the numbers to 24, or even higher like 48, 100. Increase once, monitor for few days, if it goes well, increase again. I think set to 50 (and higher) is quite alright with so much RAM.

craig wrote:

Any comment on 30 000 emails a day?

Easy.

9

Re: Hardware requirements

Hi Zhang,

Thanks for your reply. I may try those configuration changes to Amavisd and Postfix, but at this point this server is on the way out. I wish I had known I could venture that high and that it would make a difference a few years ago, but oh well.

So to get back to my original question, "easy" doesn't really mean anything to me. Sorry. Assuming decent I/O performance, is 8 GB enough to process 30 000 emails a day with Amavisd running?


Craig

10

Re: Hardware requirements

craig wrote:

Hi Zhang,

Thanks for your reply. I may try those configuration changes to Amavisd and Postfix, but at this point this server is on the way out. I wish I had known I could venture that high and that it would make a difference a few years ago, but oh well.

So to get back to my original question, "easy" doesn't really mean anything to me. Sorry. Assuming decent I/O performance, is 8 GB enough to process 30 000 emails a day with Amavisd running?

Sometimes it pays to hire a professional (like Zhang) for consultation to solve problems... wink

30000 mails per day translates to just 20 mails per minute. I don't see why this should be a problem even will less RAM. So again: Easy. smile

11

Re: Hardware requirements

hws wrote:

Sometimes it pays to hire a professional (like Zhang) for consultation to solve problems... wink

30000 mails per day translates to just 20 mails per minute. I don't see why this should be a problem even will less RAM. So again: Easy. smile

Thanks for your "winky" suggestion that I hire a "professional". I do pay an annual licence fee (and have also occasionally bought Zhang "a coffee"), and for that I expect support -- especially if it's in a public forum where the solutions to my issues may help other paying customers -- which includes questions being addressed until the "ticket" (or topic/thread in the case of a forum) is closed. (Anyway, this is essentially a pre-sales question.) Zhang does generally have decent documentation, but on this topic it is strangely silent. "Easy" is a single word that doesn't mean anything in a "professional" or technical context, and means even less if you can't back it up with specifics.

But thanks for your "input".

12

Re: Hardware requirements

Zhang,

For what it's worth at this point, considering I'm replacing this server, I tried increasing the values in the Amavis and Postfix configuration files first to 24, then to 48, then to 100. Each time, when I re-enabled amavisd, CPU usage immediately tripled (from about 20% to 60%, eventually reaching 80%; see the obvious spike between about 12:30 and 13:30 on the attached graph) and the mail queue immediately started growing from nothing (except a handful of outbound mails being deferred due to greylisting and various similar reasons) to over a hundred inbound and internal emails. After about five minutes when the queue reached over a hundred emails (and growing) I disabled amavisd and the queue took 15-20 minutes to clear. Then I tried raising the numbers in the Amavis and Postfix configuration files another increment. After three tries I gave up and disabled amavisd again, which has been disabled on this server for several years now, almost since the day it was set up.

Simply put, Amavis on this server cannot and does not function, despite having 24 GB of RAM, 8 CPUs and an SSD. I don't get it.

However, that aside, I'd like to revisit two issues that were discussed here previously. These are only issues because in my own experience (as shown above), running on an all-SSD cloud server (Linode), the server could not keep up even with 24 GB of RAM. It does not matter to me if Google runs all of Gmail on a single iRedMail server in Sergey Brin's basement if my own server won't handle 2000 users and 30 000 "easy" emails a day.

  1. Above you stated, "Obviously, mailboxes should be put on SSD, because this is a mail server, all services are working with the mailboxes", yet one of the cluster tutorials you link to -- one of only two items in your documentation that seems to refer to processing mail on multiple servers -- talks about putting the mailstore on NFS. (And anyway, why would Amavis be working with static mail boxes at rest that are storing mail that has already been processed?) So my question is, why do you say above that the mailstore should be on a local SSD when that contradicts the aforementioned tutorial on setting up a cluster?

  2. And can iRedMail be easily configured to pass email onto a second server rather than storing the email locally? (Obviously iRedAdmin-Pro would need to operate across two servers.) I'm considering doing all of the anti-spam processing on one server and having the mail that gets through forwarded to a storage server.

Thanks again, as always, for your time.


Craig

Post's attachments

nc027_cpu_20180327_1_day_2_redacted.png
nc027_cpu_20180327_1_day_2_redacted.png 31.14 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

13

Re: Hardware requirements

Interesting problem. Have you monitored the running server with atop to see where the bottleneck lies?

14

Re: Hardware requirements

sayso wrote:

Interesting problem. Have you monitored the running server with atop to see where the bottleneck lies?

Thanks for your reply. No. I have had other ideas since this problem first appeared back when I set this server up in late 2013, but atop wasn't one of the tools I used since I hadn't heard of it then. Now, for unrelated reasons, it's simply time to replace this server and move on and waste no more of my time with it.

I guess my case must be so far outside the bell curve, and I just need to hope that the next server won't choke like this one does. If this happened to everyone the forum would be full of complaints and nobody would use iRedMail, so I must be special. smile

I'd just like Zhang to answer my last two questions so that I can finalise my plans and keep using his software.

15

Re: Hardware requirements

About Amavisd performance:

*) you need to enable debug option in Amavisd to check which operation takes long time, then fix it. For example, some servers may have slow DNS query, this will cause the stalled queue while busy. FYI: https://docs.iredmail.org/debug.amavisd.html
*) About the CPU usage, you process more emails concurrently, then more CPU/RAM it will take, that's for sure.
*) It's not about increasing the number of concurrently processed emails endlessly. If you want to process as many as possible, you need to tune it and find the best balance.

About the SSD disk and NFS for mailbox storage, I think you didn't understand the situation when we talk about SSD and NFS.

*) when we talk about SSD, we're talking about local disk storage. The faster the better.
*) when we talk about NFS, we're talking about a remote mailbox storage for cluster. We need to access mailboxes from different servers concurrently, and NFS is an option. If you have faster storage like NAS/SAN storage, that's better.

craig wrote:

And can iRedMail be easily configured to pass email onto a second server rather than storing the email locally? (Obviously iRedAdmin-Pro would need to operate across two servers.) I'm considering doing all of the anti-spam processing on one server and having the mail that gets through forwarded to a storage server.

Sure you can use iRedMail as a mail server gateway, but you need to tune it yourself. Unfortunately, we don't have such document yet.

16

Re: Hardware requirements

craig wrote:

I do pay an annual licence fee (and have also occasionally bought Zhang "a coffee"), and for that I expect support

*) The iRedAdmin-Pro license covers support for iRedAdmin-Pro itself, not iRedMail server.
*) I appreciate your "coffee", but this is not same as a support ticket.

If you think the answer "Easy" (or whatever) is too simple, feel free to ask me to explain with more details.

17

Re: Hardware requirements

Hi Zhang,

Well, if the server is processing 30 000 emails a day "easily" when not using Amavis, then the massive increase in CPU does not make sense if I'm still processing the same number of emails.

But please ignore my problems on my current server. As I posted a few seconds before you, I'm moving on and not willing to waste more time trying to debug it.

Yes, I understand the difference between a local SSD and a remote NFS set-up. In the absence of concrete information that will set my mind at ease I will just carry on with my plans to set up iRedMail on a new server and hope for the best.


Craig

18

Re: Hardware requirements

It might be a good chance for you to debug Amavisd and get better performance. It sounds like (to me) that your server has some kind of bottleneck. MAYBE slow DNS query, or other part. It will be interesting to figure it out.

19

Re: Hardware requirements

ZhangHuangbin wrote:

*) The iRedAdmin-Pro license covers support for iRedAdmin-Pro itself, not iRedMail server.

Good to know, but the two are closely intertwined. Saying you'll support one and not the other doesn't make sense to me if you're selling a commercial product based on the part you say you won't support.

ZhangHuangbin wrote:

*) I appreciate your "coffee", but this is not same as a support ticket.

Good to know too. Didn't really think or suggest it was; I was just pointing out that I'm not expecting everything for free. I really think you need to re-evaluate your support model for people who actually pay for a licence though. I'd be happy to pay for a support ticket if I knew that my problem would be resolved, but you should also be motivated to solve problems with your product so that it's reputation improves all the time. I'm not into throwing $99 away on a "hope".

ZhangHuangbin wrote:

If you think the answer "Easy" (or whatever) is too simple, feel free to ask me to explain with more details.

The problem is that I'm already made to feel like I'm "imposing" when I post here, which is not a good thing, so if you're unwilling to offer more than a single word in answer to my question, why would I ask for more detail? I only run one primary mail server so I don't have the breadth of experience to know whether 30 000 emails a day on 8GB is not much, a moderate amount, or a lot. I know 30 000 is not a lot, but it's the 8 GB part that is the unknown for me, and you must understand my concern given that 24 GB is not enough for me at the moment with whatever is causing my Amavis problem. That's why I'm so reluctant to commit the time to putting iRedMail and iRedAdmin-Pro on another server and possibly open myself up to more headaches.

Zhang, you have a good product with decent documentation and it obviously works for most people better than it has worked for me. I hope that next month my new server will be up and running and my users will be thanking me for the reduction in spam. And when/if that happens I will be more than happy to report it here and tell everyone the problems on my old server were obviously an aberration.

ZhangHuangbin wrote:

It might be a good chance for you to debug Amavisd and get better performance. It sounds like (to me) that your server has some kind of bottleneck. MAYBE slow DNS query, or other part. It will be interesting to figure it out.

You've mentioned the DNS a couple of times, and I plan to install a caching nameserver on the new server. In fact, I might even hire you to do that for me instead of doing it myself.

I'll increase the log level in Amavis and see what I can learn and pass it onto you.

Thanks, again, for your time.

P.S.: You really need to increase the time-out on the log-in for this board. Thankfully I didn't lose my post when I submitted it because I had copied it to my clipboard before I submitted when I found out I was logged out.

20

Re: Hardware requirements

Slow DNS will mess up your day. atop will tell you if you're running into a hardware limit.  you'd do well to check both DNS and hardware to find the root of the problem

FWIW, we used to process 20k email's a day on something like penitum-II hardware with 5400rpm IDE disks. the files were smaller but still....

21

Re: Hardware requirements

sayso wrote:

Slow DNS will mess up your day. atop will tell you if you're running into a hardware limit.  you'd do well to check both DNS and hardware to find the root of the problem

Thanks. Thing is, Postfix is configured to check DNSBLs outside of Amavis anyway, and having no problem. So I'm dubious about it being a DNS issue.

sayso wrote:

FWIW, we used to process 20k email's a day on something like penitum-II hardware with 5400rpm IDE disks. the files were smaller but still....

Yeah, last time I checked email has been around longer than SSDs. smile

22

Re: Hardware requirements

SpamAssassin will check some DNSBL services too (default spamassassin settings), so you'd better double check.

23

Re: Hardware requirements

I would never think of running a mail server handling 30k mails per day without a local caching name server. Even if this is not your problem, it will help a lot!

It takes 5 minutes to install eg. pdns-recursor at a server. Time well spent! smile

24

Re: Hardware requirements

hws wrote:

I would never think of running a mail server handling 30k mails per day without a local caching name server. Even if this is not your problem, it will help a lot!

It takes 5 minutes to install eg. pdns-recursor at a server. Time well spent! smile


+1

One of the first optimizations I did to iredmail was to add a local DNS cache because I know how terribly systems can perform when DNS is slow.  Yes postfix will perform DNS queries, but postfix does not perform DNSBL lookups on the  domains/URLs in the headers/body of the emails.  Nor does it validate spf/dkim records.    So it would not surprise me that if you had poor/slow DNS resolution times that you would start seeing email backing up. 

I installed unbound myself (despite being a lifelong user of BIND) and the only configuration changes I made to its configuration file was to setup a statistics interval because I wanted to be able to graph usage using munin.  And don't forget to add an entry to /etc/resolv.conf so the system actually uses the local cache - after you've tested that it does actually work - eg. dig +short google.com. @127.0.0.1

For the record, my system is doing ~10K emails a day with 2 cores and 4GB of ram in a public cloud environment and a mix of SSD and spinning disk and I've never run into a case where postfix started queuing up emails.

25

Re: Hardware requirements

I should, as I promised earlier, report back that I did set up a new server with iRedMail and iRedAdmin-Pro -- actually, I got Zhang to set it up -- and it has been running beautifully for two months. I still don't know for sure the cause of the problems on my old server, but despite the fact that I earlier dismissed it being a DNS issue, I did not have a DNS caching server set up previously, and now I do, so perhaps that *was* the problem.

I did still go for more horsepower than was possibly necessary, with 8 GB of RAM with four virtual CPUs.