1 (edited by tasiot 2015-06-26 15:59:00)

Topic: SOLVED : Slow delivery or sending, Amavis? SA?

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version: debian 7.8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache2
- Manage mail accounts with iRedAdmin-Pro? No, with Postfix-Admin 2.3.7
- Related log if you're reporting an issue:
====

Hi everybody,

My server seem slow but I don't understand why.

Jun 24 10:41:13 s-mail1 amavis[22000]: (22000-05) Passed CLEAN {RelayedInternal}, MYUSERS LOCAL [xxx.xxx.xxx.xxx]:44206 [xxx.xxx.xxx.xxx] <name1@domain.tld> -> <name2@domain.tld>, Queue-ID: 40B44481961, Message-ID: <2F6A7F1D-54A2-4466-96CF-2E132F8EB1D3@domain.tld>, mail_id: px0o3FQ3pr6w, Hits: -1, size: 867, queued_as: 7A29F48196E, dkim_new=dkim:domain.tld, 30169 ms

I think that 30,1 seconds to deliver an email locally, this is slow.

After searching on your knowledge database, I have disabled the virus & spam checking for local mails, like that:

$policy_bank{'MYUSERS'} = {
...
    # don't perform spam/virus/header check.
    bypass_spam_checks_maps => [1],
    bypass_virus_checks_maps => [1],
    bypass_header_checks_maps => [1],

    # allow sending any file names and types
    bypass_banned_checks_maps => [1],
...

Now, it is more fast.

Jun 25 15:37:48 s-mail1 amavis[18492]: (18492-02) Passed CLEAN {RelayedInternal}, MYUSERS LOCAL [xxx.xxx.xxx.xxx]:55349 [xxx.xxx.xxx.xxx] <name1@domain.tld> -> <name2@domain.tld>, Queue-ID: 92A00481965, Message-ID: <2E3A32B1-955A-41AF-AC2D-65995FAC808B@domain.tld>, mail_id: Gc1xDNbzIzOm, Hits: -, size: 7222134, queued_as: D53D5481977, dkim_new=dkim:domain.tld, 10608 ms

But why amavis task still lasts 10.6 seconds?

At the start of file /etc/amavis/conf.d/50-user, I have correctly defined my domain and my IP class (I have a block RIPE XXX.XXX.XXX.0/29):

chomp($mydomain = "mydomain.tld");
@local_domains_maps = 1;
@mynetworks = qw( 127.0.0.0/8 [::1] [FE80::]/10 [FEC0::]/10
                  10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 XXX.XXX.XXX.0/29 );

Can anyone help me?

----

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

2

Re: SOLVED : Slow delivery or sending, Amavis? SA?

How much RAM do you have on this server? and CPU cores? Do you use a fast DNS server (i don't mean you should run a DNS server on localhost)?

3

Re: SOLVED : Slow delivery or sending, Amavis? SA?

It's a VM with 5 Gb of RAM, 4 CPU Intel(R) Xeon(R) CPU E5-1620 v2 @ 3.70GHz.

I will install bind on this VM a check if it's more fast…

4

Re: SOLVED : Slow delivery or sending, Amavis? SA?

It works ! After apt-get update and apt-get install bind9, the amavis task is faster !

Before installing DNS locally : task lasted between 10 and 40 seconds
After installing DNS locally : task lasted between 0,07 and 5 seconds

Conclusion : you must have a DNS server locally to caching hosts resolution

Thank you. My problem is now solved.

5

Re: SOLVED : Slow delivery or sending, Amavis? SA?

Just to make sure others don't go nuts installing a local DNS unless it is absolutely necessary... It is important to have good DNS response time and resolution, specially for your mailserver services, spam filtering and so on. Irrespective, you are not required to have a local DNS deployed to make things work properly. It looks like DNS queries from your server were taking a long time to respond and that's why your workaround was to deploy your own service to cache DNS queries. I personally don't like to sit an extra service in the mailbox, not a DNS service anyways.

For others who run into something similar, find out the fastest DNS servers around you and use those servers instead:

# cd /tmp
# wget http://namebench.googlecode.com/files/namebench-1.1.tgz
# tar xvf namebench-1.1.tgz
# ./namebech-1.1/namebench.py

Use the servers recommended by namebench if you don't have a local DNS in your network. (I avoid using OpenDNS myself for mailserver queries) - do your own research.

Cheers!

6

Re: SOLVED : Slow delivery or sending, Amavis? SA?

Interesting.

Thank you for your post.