Mailing List Archive

LMTPD=>Postfix tune up
Hi,



I'd like to ask the list, how many processes are you using, in postfix
master.cf to dbmail-lmtpd.



I was using it's maximum:



dbmail-lmtp unix - - n - - lmtp -o
disable_dns_lookups=yes



and changed it to:



dbmail-lmtp unix - - n - 20 lmtp -o
disable_dns_lookups=yes



Please share your confs.

Thanks in advanced,
Re: LMTPD=>Postfix tune up [ In reply to ]
Am 03.11.2014 um 16:23 schrieb Jorge Bastos:
> I’d like to ask the list, how many processes are you using, in postfix
> master.cf to dbmail-lmtpd.
>
> I was using it’s maximum:
>
> dbmail-lmtp unix - - n - - lmtp -o
> disable_dns_lookups=yes
>
> and changed it to:
>
> dbmail-lmtp unix - - n - 20 lmtp -o
> disable_dns_lookups=yes

ONE ONE AND ONE AGAIN

dbmail-lmtpd is *single threaded*
_____________________________________________________

dbmail-lmtp unix - - n - 1 lmtp -o
disable_dns_lookups=yes -o max_idle=3600 -o max_use=500
_____________________________________________________

main.cf:

lmtp_destination_concurrency_limit = 1
dbmail-lmtp_destination_concurrency_limit = 1
dbmail-lmtp_destination_rate_delay = 0
Re: LMTPD=>Postfix tune up [ In reply to ]
> > dbmail-lmtp unix - - n - - lmtp
> -o
> > disable_dns_lookups=yes
> >
> > and changed it to:
> >
> > dbmail-lmtp unix - - n - 20 lmtp
> -o
> > disable_dns_lookups=yes
>
> ONE ONE AND ONE AGAIN
>
> dbmail-lmtpd is *single threaded*

I'll take that in consideration :)

Changed to 1, let's see the behavior!

_______________________________________________
DBmail mailing list
DBmail@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail
Re: LMTPD=>Postfix tune up [ In reply to ]
Reindl,

In fact it has a more solid behavior, I've set it to 2 processes.

But delivery is slowwww in this way, at least for the traffic that I have,

I have around ~200/250 inbound emails/min

> -----Original Message-----
> From: dbmail-bounces@dbmail.org [mailto:dbmail-bounces@dbmail.org] On
> Behalf Of Jorge Bastos
> Sent: segunda-feira, 3 de Novembro de 2014 15:51
> To: 'DBMail mailinglist'
> Subject: Re: [Dbmail] LMTPD=>Postfix tune up
>
> > > dbmail-lmtp unix - - n - -
> lmtp
> > -o
> > > disable_dns_lookups=yes
> > >
> > > and changed it to:
> > >
> > > dbmail-lmtp unix - - n - 20
> lmtp
> > -o
> > > disable_dns_lookups=yes
> >
> > ONE ONE AND ONE AGAIN
> >
> > dbmail-lmtpd is *single threaded*
>
> I'll take that in consideration :)
>
> Changed to 1, let's see the behavior!
>
> _______________________________________________
> DBmail mailing list
> DBmail@dbmail.org
> http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

_______________________________________________
DBmail mailing list
DBmail@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail
Re: LMTPD=>Postfix tune up [ In reply to ]
Am 03.11.2014 um 18:12 schrieb Jorge Bastos:
> In fact it has a more solid behavior, I've set it to 2 processes.

too much - Paul *explicitly* recommends 1 and in fact it can't handle
more than one at the same time

> But delivery is slowwww in this way, at least for the traffic that I have,
> I have around ~200/250 inbound emails/min

then you need more then once instance on different ports so that each
domain can have it's own lmtpd-daemon in transport maps or find a proxy
solution between the MTA and dbmail spread incoming mail to the
different instances

frankly at such a high amount one has typically not only a single MTA
but DNS round robin and each of them has it's own lmtpd-instance
connecting to the same database over network

just because with that mail traffic you hardly have a single machine
able to process the load of a contentscanner and with a contentscanner
and sensible filtering (postscreen with dnsbl scoring...) i doubt the
lmtpd will see 250 messages per minute :-)
Re: LMTPD=>Postfix tune up [ In reply to ]
Reindl,

That's why I have some delays when someone remembers to send some messages a
bit more than normal :)

> -----Original Message-----
> From: dbmail-bounces@dbmail.org [mailto:dbmail-bounces@dbmail.org] On
> Behalf Of Reindl Harald
> Sent: segunda-feira, 3 de Novembro de 2014 17:21
> To: dbmail@dbmail.org
> Subject: Re: [Dbmail] LMTPD=>Postfix tune up
>
>
>
> Am 03.11.2014 um 18:12 schrieb Jorge Bastos:
> > In fact it has a more solid behavior, I've set it to 2 processes.
>
> too much - Paul *explicitly* recommends 1 and in fact it can't handle
> more than one at the same time
>
> > But delivery is slowwww in this way, at least for the traffic that I
> > have, I have around ~200/250 inbound emails/min
>
> then you need more then once instance on different ports so that each
> domain can have it's own lmtpd-daemon in transport maps or find a proxy
> solution between the MTA and dbmail spread incoming mail to the
> different instances
>
> frankly at such a high amount one has typically not only a single MTA
> but DNS round robin and each of them has it's own lmtpd-instance
> connecting to the same database over network
>
> just because with that mail traffic you hardly have a single machine
> able to process the load of a contentscanner and with a contentscanner
> and sensible filtering (postscreen with dnsbl scoring...) i doubt the
> lmtpd will see 250 messages per minute :-)
>
>
>
>


_______________________________________________
DBmail mailing list
DBmail@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail
Re: LMTPD=>Postfix tune up [ In reply to ]
On 03/11/14 11:21, Reindl Harald wrote:
>
>
> Am 03.11.2014 um 18:12 schrieb Jorge Bastos:
>> In fact it has a more solid behavior, I've set it to 2 processes.
>
> too much - Paul *explicitly* recommends 1 and in fact it can't handle
> more than one at the same time
It can.
You just need to run two or more (single-threaded) dbmail-lmtp processes
listening on a different IP address each.
You should be able to run as many dbmail-lmtpd processes as CPU cores in
your RDBMS for optimal performance.
>
>> But delivery is slowwww in this way, at least for the traffic that I
>> have,
>> I have around ~200/250 inbound emails/min
Parallelizing dbmail-lmtpd might help in performance.
You might also be interested in applying this patch for an extra 400%
performance gain in message insertion, no mather if the message is
received by dbmail-dmtp, dbmail-lmtpd or dbmail-imapd.

Only in dbmail-3.0.2/src: .dm_db.c.swp
Only in dbmail-3.0.2/src: 3.0-header_cache_perf.patch
diff -uri dbmail-3.0.2.orig/src/dbmail-message.c dbmail-3.0.2/src/dbmail-message.c
--- dbmail-3.0.2.orig/src/dbmail-message.c 2012-03-11 02:02:30.000000000 -0600
+++ dbmail-3.0.2/src/dbmail-message.c 2013-07-16 02:15:28.000000000 -0500
@@ -1621,7 +1621,7 @@
unsigned char *raw;
unsigned i;
time_t date;
- volatile gboolean isaddr = 0, isdate = 0, issubject = 0;
+ volatile gboolean isaddr = 0, isdate = 0, issubject = 0, isblacklist = 0;
const char *charset = dbmail_message_get_charset(self);
gchar *sortfield = NULL, *datefield = NULL;
InternetAddressList *emaillist;
@@ -1652,6 +1652,20 @@
issubject=1;
else if (g_ascii_strcasecmp(header,"Date")==0)
isdate=1;
+ else if (g_ascii_strcasecmp(header,"received")==0)
+ isblacklist=1;
+ else if (g_ascii_strcasecmp(header,"content-type")==0)
+ isblacklist=1;
+ else if (g_ascii_strcasecmp(header,"x-spam-status")==0)
+ isblacklist=1;
+ else if (g_ascii_strcasecmp(header,"x-spam-score")==0)
+ isblacklist=1;
+ else if (g_ascii_strcasecmp(header,"dkim-signature")==0)
+ isblacklist=1;
+ else if (g_ascii_strcasecmp(header,"domainkey-signature")==0)
+ isblacklist=1;
+ else if (g_ascii_strcasecmp(header,"authentication-results")==0)
+ isblacklist=1;

values = g_relation_select(self->headers,header,0);

@@ -1666,6 +1682,11 @@
if (value) g_free(value);
continue;
}
+
+ if (isblacklist == 1) {
+ if (value) g_free(value);
+ continue;
+ }

// Generate additional fields for SORT optimization
if(isaddr) {
diff -uri dbmail-3.0.2.orig/src/dm_db.c dbmail-3.0.2/src/dm_db.c
--- dbmail-3.0.2.orig/src/dm_db.c 2012-03-11 02:02:30.000000000 -0600
+++ dbmail-3.0.2/src/dm_db.c 2013-07-16 02:29:17.000000000 -0500
@@ -1480,7 +1480,8 @@
r = db_query(c, "SELECT p.id "
"FROM %sphysmessage p "
"LEFT JOIN %sheader h ON p.id = h.physmessage_id "
- "WHERE h.physmessage_id IS NULL", DBPFX, DBPFX);
+ "WHERE h.physmessage_id IS NULL "
+ "ORDER BY p.id DESC", DBPFX, DBPFX);
while (db_result_next(r)) {
id = g_new0(u64_t,1);
*id = db_result_get_u64(r, 0);

Another extra performance gain can be achieved by cleaning unneeded
tuples from dbmail_header and dbmail_header_value tables.

>
> then you need more then once instance on different ports so that each
> domain can have it's own lmtpd-daemon in transport maps or find a
> proxy solution between the MTA and dbmail spread incoming mail to the
> different instances

> frankly at such a high amount one has typically not only a single MTA
> but DNS round robin and each of them has it's own lmtpd-instance
> connecting to the same database over network
You only need to resolve your LMTP server to more than one IP address
using DNS round robin, then have all your domains be delivered to all
your dbmail-lmtpd instances.
>
> just because with that mail traffic you hardly have a single machine
> able to process the load of a contentscanner and with a contentscanner
> and sensible filtering (postscreen with dnsbl scoring...) i doubt the
> lmtpd will see 250 messages per minute :-)
>
>
>
>
>
>
>
> _______________________________________________
> DBmail mailing list
> DBmail@dbmail.org
> http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail


--
Sandino Araico Sánchez
http://sandino.net