Note that there are some explanatory texts on larger screens.

plurals
  1. POSending newsletter using PHP SwiftMailer and SMTP
    primarykey
    data
    text
    <p>I send daily a newsletter to about 20K recipients. After moving to other server I need about six times more time to this using the same PHP scripts – I tried many different settings but had no luck with it (<a href="https://stackoverflow.com/questions/19682726/sending-newsletter-using-php-mail-and-postfix">please see this post</a>). The email server seems to be properly configured (with regard to spam, relay and viruses), the server runs with Plesk 11.5.30.</p> <p>Doing many experiments, changing PHP scripts and Postfix settings I was able to achieve the best performance with the following:</p> <ol> <li>Sending emails from PHP using SwiftMailer.</li> <li>Using SMTP (local account) as transport.</li> <li>Dividing recipients list in four parts and starting separate PHP-CLI process for each one.</li> </ol> <p>When I start only one process, PHP sends about 5 emails / second (which are about the same when I send emails using mail() function). Postfix has no problems with sending them "on the fly“ so there is almoust no queue.</p> <p>When I start four processes, PHP sends about 10 emails / second, however postfix is no more able to send them „on the fly“ (it can send only about 5 emails / second) so the queue becomes bigger and bigger. When the PHP processes are over, I have about 4500 emails in my queue. And here comes the interesting part: when there are no more active PHP processes sending emails, Postfix „accelerates“ to sending about 20 emails / second. Would Postfix be able to send the emails at this rate while PHP is delivering new emails? there would be no queue and it would solve my problem.</p> <p>I would appreciate any idea what could I do to improve the performance of my script and server sending the newsletter.</p> <p>Here comes the Postfix configuration:</p> <pre><code>root@hostname:~# postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases, hash:/var/spool/postfix/plesk/aliases append_dot_mydomain = no biff = no config_directory = /etc/postfix disable_vrfy_command = yes inet_interfaces = all inet_protocols = ipv4 mailbox_size_limit = 0 mailman_destination_recipient_limit = 1 message_size_limit = 51200000 mydestination = (none), localhost, localhost.localdomain, localhost mydomain = domain.com myhostname = myhostname.com mynetworks = 127.0.0.0/8 [::1]/128 my.ip.add.ress plesk_virtual_destination_recipient_limit = 1 readme_directory = no recipient_delimiter = + relayhost = sender_dependent_default_transport_maps = hash:/var/spool/postfix/plesk/sdd_transport_maps smtp_connect_timeout = 10s smtp_helo_timeout = 100s smtp_send_xforward_command = yes smtp_tls_security_level = may smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtp_use_tls = no smtpd_authorized_xforward_hosts = 127.0.0.0/8 [::1]/128 smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_rbl_client zen.spamhaus.org smtpd_proxy_timeout = 3600s smtpd_recipient_restrictions = permit_mynetworks, check_client_access pcre:/var/spool/postfix/plesk/no_relay.re, permit_sasl_authenticated, reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sender_restrictions = check_sender_access hash:/var/spool/postfix/plesk/blacklists, permit_sasl_authenticated, check_client_access pcre:/var/spool/postfix/plesk/non_auth.re smtpd_timeout = 3600s smtpd_tls_cert_file = /etc/postfix/postfix_default.pem smtpd_tls_key_file = $smtpd_tls_cert_file smtpd_tls_security_level = may smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes transport_maps = , hash:/var/spool/postfix/plesk/transport virtual_alias_maps = $virtual_maps, hash:/var/spool/postfix/plesk/virtual virtual_gid_maps = static:31 virtual_mailbox_base = /var/qmail/mailnames virtual_mailbox_domains = $virtual_mailbox_maps, hash:/var/spool/postfix/plesk/virtual_domains virtual_mailbox_limit = 0 virtual_mailbox_maps = , hash:/var/spool/postfix/plesk/vmailbox virtual_transport = plesk_virtual virtual_uid_maps = static:110 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload