Nosso novo servidor de postfix que montamos apenas para o nosso boletim informativo semanal parece muito lento, demora mais do que o dobro do tempo que o nosso antigo servidor em 1 & 1 fez.
Os últimos dias eu tentei descobrir o que está errado, seguindo este guia tanto quanto eu poderia. link
Assim, no meu grupo de teste, eu envio e-mails para 440 destinatários, todos em nosso domínio, apenas para fins de teste.
Nosso antigo 1 & 1 smtp leva de 7 a 10 minutos, o nosso próprio postfix precisa de 20 a 30 minutos. Carregar no htop é sempre muito baixo: CPU pairando cerca de 2 - 5%, Mem está em 200MB / 4GB. No iotop, a maior GRAVAÇÃO total do DISCO que vi foi de cerca de 200kb / s.
Como afirmado no guia acima, dei uma olhada nas saídas qshape durante o envio, mas as filas estavam quase sempre vazias.
Espero que haja alguém que possa nos dar algumas dicas sobre onde encontrar o problema, qualquer ajuda é apreciada.
Aqui está a saída do iostat durante o envio:
Linux 4.4.27-x86_64-jb1 (j3XXXXXX.servers.xxxxxxxx.net) 02/22/2017 _x86_64_ (2 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
0.25 0.04 0.34 0.01 0.01 99.37
Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
xvda 0.84 4.70 14.43 384062 1180244
xvdb 0.00 0.01 0.00 468 0
Isto é o que os logs de e-mail parecem ao enviar para o nosso grupo de teste:
Feb 22 09:22:24 j3XXXXXX postfix/smtpd[3333]: connect from superwebmailer[93.180.XXX.XXX]
Feb 22 09:22:26 j3XXXXXX postfix/smtpd[3333]: 2684A42D0B: client=superwebmailer[93.180.XXX.XXX], sasl_method=LOGIN, [email protected]
Feb 22 09:22:26 j3XXXXXX postfix/cleanup[3334]: 2684A42D0B: message-id=<[email protected]>
Feb 22 09:22:26 j3XXXXXX postfix/qmgr[3174]: 2684A42D0B: from=<[email protected]>, size=124666, nrcpt=1 (queue active)
Feb 22 09:22:26 j3XXXXXX postfix/smtpd[3333]: disconnect from superwebmailer[93.180.XXX.XXX]
Feb 22 09:22:26 j3XXXXXX postfix/smtp[3327]: 2684A42D0B: to=<[email protected]>, relay=mx00.kundenserver.de[212.227.15.41]:25, delay=0.17, delays=0.01/0/0.03/0.13, dsn=2.0.0, status=sent (250 Requested mail action okay, completed: id=0M3qVy-1cPTIu0nOk-00rbOr)
Feb 22 09:22:26 j3XXXXXX postfix/qmgr[3174]: 2684A42D0B: removed
Feb 22 09:22:26 j3XXXXXX postfix/smtpd[3333]: connect from superwebmailer[93.180.XXX.XXX]
Feb 22 09:22:28 j3XXXXXX postfix/smtpd[3333]: 331F542D0B: client=superwebmailer[93.180.XXX.XXX], sasl_method=LOGIN, [email protected]
Feb 22 09:22:28 j3XXXXXX postfix/cleanup[3334]: 331F542D0B: message-id=<[email protected]>
Feb 22 09:22:28 j3XXXXXX postfix/qmgr[3174]: 331F542D0B: from=<[email protected]>, size=124666, nrcpt=1 (queue active)
Feb 22 09:22:28 j3XXXXXX postfix/smtpd[3333]: disconnect from superwebmailer[93.180.XXX.XXX]
Feb 22 09:22:28 j3XXXXXX postfix/smtp[3326]: 331F542D0B: to=<[email protected]>, relay=mx00.kundenserver.de[212.227.15.41]:25, delay=0.19, delays=0.01/0/0.03/0.15, dsn=2.0.0, status=sent (250 Requested mail action okay, completed: id=0M5mJx-1cQrHx11WT-00xvuo)
Feb 22 09:22:28 j3XXXXXX postfix/qmgr[3174]: 331F542D0B: removed
Feb 22 09:22:28 j3XXXXXX postfix/smtpd[3333]: connect from superwebmailer[93.180.XXX.XXX]
Feb 22 09:22:30 j3XXXXXX postfix/smtpd[3333]: D390F42D0B: client=superwebmailer[93.180.XXX.XXX], sasl_method=LOGIN, [email protected]
Feb 22 09:22:30 j3XXXXXX postfix/cleanup[3334]: D390F42D0B: message-id=<[email protected]>
Feb 22 09:22:30 j3XXXXXX postfix/qmgr[3174]: D390F42D0B: from=<[email protected]>, size=124666, nrcpt=1 (queue active)
Feb 22 09:22:30 j3XXXXXX postfix/smtpd[3333]: disconnect from superwebmailer[93.180.XXX.XXX]
Feb 22 09:22:31 j3XXXXXX postfix/smtp[3327]: D390F42D0B: to=<[email protected]>, relay=mx00.kundenserver.de[212.227.15.41]:25, delay=0.21, delays=0.01/0/0.03/0.17, dsn=2.0.0, status=sent (250 Requested mail action okay, completed: id=0LsRC8-1cDwze3m9I-0122lz)
Feb 22 09:22:31 j3XXXXXX postfix/qmgr[3174]: D390F42D0B: removed
Feb 22 09:22:31 j3XXXXXX postfix/smtpd[3333]: connect from superwebmailer[93.180.XXX.XXX]
Feb 22 09:22:33 j3XXXXXX postfix/smtpd[3333]: 4077542D0B: client=superwebmailer[93.180.XXX.XXX], sasl_method=LOGIN, [email protected]
Feb 22 09:22:33 j3XXXXXX postfix/cleanup[3334]: 4077542D0B: message-id=<[email protected]>
Feb 22 09:22:33 j3XXXXXX postfix/qmgr[3174]: 4077542D0B: from=<[email protected]>, size=124666, nrcpt=1 (queue active)
Feb 22 09:22:33 j3XXXXXX postfix/smtpd[3333]: disconnect from superwebmailer[93.180.XXX.XXX]
Feb 22 09:22:33 j3XXXXXX postfix/smtp[3326]: 4077542D0B: to=<[email protected]>, relay=mx00.kundenserver.de[212.227.15.41]:25, delay=0.16, delays=0.01/0/0.04/0.1, dsn=2.0.0, status=sent (250 Requested mail action okay, completed: id=0MGKrT-1cbHfq1Ivf-00FB48)
Feb 22 09:22:33 j3XXXXXX postfix/qmgr[3174]: 4077542D0B: removed
Às vezes, o postfix / anvil registra o seguinte:
Feb 22 09:12:26 j3XXXXXX postfix/anvil[3178]: statistics: max connection rate 27/60s for (smtp:93.180.XXX.XXX) at Feb 22 09:09:05
Feb 22 09:12:26 j3XXXXXX postfix/anvil[3178]: statistics: max connection count 1 for (smtp:93.180.XXX.XXX) at Feb 22 09:02:27
Este é o nosso postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
default_destination_concurrency_limit = 40
default_process_limit = 700
disable_vrfy_command = yes
dovecot_destination_recipient_limit = 100
inet_interfaces = all
inet_protocols = all
initial_destination_concurrency = 10
local_transport = virtual
mailbox_size_limit = 0
mydestination = localhost.mail.xxxxxxx.xxx, j3XXXXXX.servers.xxxxxxxx.net, localhost.servers.xxxxxxxx.net, localhost
myhostname = mail.xxxxxxx.xxx
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_nam
smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = private/auth_dovecot
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
smtpd_sender_restrictions = reject_unknown_sender_domain
smtpd_tls_cert_file = /etc/postfix/ssl/mailserver.crt
smtpd_tls_key_file = /etc/postfix/ssl/mailserver.key
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_gid_maps = static:6000
virtual_mailbox_base = /var/vmail/
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual-domains-maps.cf
virtual_mailbox_limit = 0
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_minimum_uid = 104
virtual_transport = dovecot
virtual_uid_maps = static:6000
Tags email postfix smtpd newsletters