postfix tuninh

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

postfix tuninh

mami64
Hi
Sorry for to trivial e-mail and stupid question.I have a dedicated
bare-metal server. I need some tunig postfix to faster delivery (every
time i look in qshappe -it's good)
Amvis and dovecot is in the external server to.


virtual_transport = lmtp:inet:10.0.100.5:24

now i change:
lmtp_destination_concurrency_limit = 100 (default it was 20)
default_destination_concurrency_limit = 100 (default it was 20)
lmtp_destination_recipient_limit = 1

default_process_limit = 1200 (this machine is fast)

and master.cf
smtp-amavis     unix    -       -       -       -       60       smtp

Is there any real soft for testing configuration performance?
I care about a smal queue and fast delivery to lmt (local dovcot-claster
with many dovecot nodes)
Reply | Threaded
Open this post in threaded view
|

Re: postfix tuninh

Wietse Venema
natan maciej milaszewski:

> Hi
> Sorry for to trivial e-mail and stupid question.I have a dedicated
> bare-metal server. I need some tunig postfix to faster delivery (every
> time i look in qshappe -it's good)
> Amvis and dovecot is in the external server to.
>
>
> virtual_transport = lmtp:inet:10.0.100.5:24
>
> now i change:
> lmtp_destination_concurrency_limit = 100 (default it was 20)
> default_destination_concurrency_limit = 100 (default it was 20)
> lmtp_destination_recipient_limit = 1
>
> default_process_limit = 1200 (this machine is fast)
>
> and master.cf
> smtp-amavis???? unix??? -?????? -?????? -?????? -?????? 60?????? smtp
>
> Is there any real soft for testing configuration performance?
> I care about a smal queue and fast delivery to lmt (local dovcot-claster
> with many dovecot nodes)

You need to measure your latencies. Fortunately, Postfix logs that
information in great detail:

       The format of the "delays=a/b/c/d" logging is as follows:

       *      a = time from message arrival to last active queue entry

       *      b = time from last active queue entry to connection setup

       *      c = time in connection setup, including DNS, EHLO and STARTTLS

       *      d = time in message transmission

Based on this you can make a more intelligent choice than maxing
out process limits and concurrencies.

To test performance, Posfix source code comes with smtp-source and
smtp-sink utilities.

To build:

Download and unpack  tarball from http://www.postfix.org/download.html
$ make makefiles shared=no (don't bother with SASL, TLS and so on)
$ make

To send 10 messages over 1 SMTP session:

$ cd src/smtpstone
$ ./smtp-source -c -m 10 -s 1 \
        -f [hidden email] -t [hidden email] \
        inet:host:port

Review the manpage in html/smtp-source.1.html for more options.

        Wietse

Reply | Threaded
Open this post in threaded view
|

Re: postfix tuning

mami64
Hi
Thanx Wietse :) i realy read logs and tested via smtp-source (as You
advised)


1)smtp-source -c -m 1000 -s 1 -C 1 -f [hidden email] -t [hidden email]
inet:127.0.0.1:25
Mar 20 16:29:07 mta-mx postfix/smtp[29226]: 48kSNL0YT4z20nvD:
to=<[hidden email]>, relay=127.0.0.1[127.0.0.1]:10628, conn_use=17,
delay=33, delays=0.01/31/0/2, dsn=2.0.0, status=sent (250 2.0.0 from
MTA(smtp:[xxx.xxx.xxx.]:10027): 250 2.0.0 Ok: queued as 48kSNz2mWXz20nRD)

Mar 20 16:29:07 mta-mx postfix/lmtp[29438]: 48kSNz2mWXz20nRD:
to=<[hidden email]>, relay=10.0.100.5[10.0.100.5]:24, conn_use=29,
delay=0.43, delays=0/0/0/0.42, dsn=2.0.0, status=sent (250 2.0.0
<[hidden email]> 6KKUF0PhdF6eAgAA5fQimA Saved)

*total delay to amavis delay=33

2)smtp-source -c -m 10 -s 1 -C 1 -f [hidden email] -t [hidden email]
inet:127.0.0.1:25
Mar 20 16:35:42 mta-mx postfix/smtp[29237]: 48kSXV6K4Wz20nRF:
to=<[hidden email]>, relay=127.0.0.1[127.0.0.1]:10628, delay=4.1,
delays=0.01/2/0/2, dsn=2.0.0, status=sent (250 2.0.0 from
MTA(smtp:[xxx.xxx.xxx.xxx]:10027): 250 2.0.0 Ok: queued as 48kSXZ6dkXz20nQt)

Mar 20 16:35:43 mta-mx postfix/lmtp[29437]: 48kSXZ6dkXz20nQt:
to=<[hidden email]>, relay=10.0.100.5[10.0.100.5]:24, delay=0.18,
delays=0/0/0/0.18, dsn=2.0.0, status=sent (250 2.0.0
<[hidden email]> eE0COM7idF5kLgAA5fQimA Saved)

*total delay to amavis delay=4.1

3) smtp-source -c -m 100 -s 1 -C 1 -f [hidden email] -t [hidden email]
inet:127.0.0.1:25
Mar 20 16:39:08  mta-mx postfix/smtp[29228]: 48kScQ50MTz20nSb:
to=<[hidden email]>, relay=127.0.0.1[127.0.0.1]:10628, conn_use=2,
delay=6.1, delays=0.01/4/0/2.1, dsn=2.0.0, status=sent (250 2.0.0 from
MTA(smtp:[xxx.xxx.xxx.xxx]:10027): 250 2.0.0 Ok: queued as 48kScX5P4Pz20nR9)

Mar 20 16:39:09 mta-mxt postfix/lmtp[825]: 48kScX5P4Pz20nR9:
to=<[hidden email]>, relay=10.0.100.5[10.0.100.5]:24, delay=0.52,
delays=0/0.3/0/0.22, dsn=2.0.0, status=sent (250 2.0.0
<[hidden email]> GDq0A53jdF4CPAAA5fQimA Saved)

*total delay to amavis delay=6.1



127.0.0.1:10628 - is local haproxy to connect to 2 external amavis+SA

in master.cf

smtp-amavis???? unix??? -?????? -?????? -?????? -?????? 60?????? smtp




On 20.03.2020 15:51, Wietse Venema wrote:

> natan maciej milaszewski:
>> Hi
>> Sorry for to trivial e-mail and stupid question.I have a dedicated
>> bare-metal server. I need some tunig postfix to faster delivery (every
>> time i look in qshappe -it's good)
>> Amvis and dovecot is in the external server to.
>>
>>
>> virtual_transport = lmtp:inet:10.0.100.5:24
>>
>> now i change:
>> lmtp_destination_concurrency_limit = 100 (default it was 20)
>> default_destination_concurrency_limit = 100 (default it was 20)
>> lmtp_destination_recipient_limit = 1
>>
>> default_process_limit = 1200 (this machine is fast)
>>
>> and master.cf
>> smtp-amavis???? unix??? -?????? -?????? -?????? -?????? 60?????? smtp
>>
>> Is there any real soft for testing configuration performance?
>> I care about a smal queue and fast delivery to lmt (local dovcot-claster
>> with many dovecot nodes)
> You need to measure your latencies. Fortunately, Postfix logs that
> information in great detail:
>
>        The format of the "delays=a/b/c/d" logging is as follows:
>
>        *      a = time from message arrival to last active queue entry
>
>        *      b = time from last active queue entry to connection setup
>
>        *      c = time in connection setup, including DNS, EHLO and STARTTLS
>
>        *      d = time in message transmission
>
> Based on this you can make a more intelligent choice than maxing
> out process limits and concurrencies.
>
> To test performance, Posfix source code comes with smtp-source and
> smtp-sink utilities.
>
> To build:
>
> Download and unpack  tarball from http://www.postfix.org/download.html
> $ make makefiles shared=no (don't bother with SASL, TLS and so on)
> $ make
>
> To send 10 messages over 1 SMTP session:
>
> $ cd src/smtpstone
> $ ./smtp-source -c -m 10 -s 1 \
> -f [hidden email] -t [hidden email] \
> inet:host:port
>
> Review the manpage in html/smtp-source.1.html for more options.
>
> Wietse
>

Reply | Threaded
Open this post in threaded view
|

Re: postfix tuning

Wietse Venema
natan maciej milaszewski:
> Hi
> Thanx Wietse :) i realy read logs and tested via smtp-source (as You
> advised)
>
>
> 1)smtp-source -c -m 1000 -s 1 -C 1 -f [hidden email] -t [hidden email]
> inet:127.0.0.1:25

How realistic is it to flood your system with 1000 messages? Fortunately
they were sent sequentially.

> Mar 20 16:29:07 mta-mx postfix/smtp[29226]: 48kSNL0YT4z20nvD:
> to=<[hidden email]>, relay=127.0.0.1[127.0.0.1]:10628, conn_use=17,
> delay=33, delays=0.01/31/0/2, dsn=2.0.0, status=sent (250 2.0.0 from
> MTA(smtp:[xxx.xxx.xxx.]:10027): 250 2.0.0 Ok: queued as 48kSNz2mWXz20nRD)

This message spent 31 seconds waiting for a before-filter SMTP client
process to become available, then no time in connection setup and
2s in delivery to Amavisd.

So there is your bottleneck.

You need to pick a process count for Amavisd that your system can
handle, then set the before-filter SMTP client concurrency and
master.cf process limit accordingly.

It is OK if the before-filter SMTP client process limit is larger
than the number of Amavisd process, but the before-filter SMTP
client concurrency should not exceed the number of Amavisd processes.

> Mar 20 16:29:07 mta-mx postfix/lmtp[29438]: 48kSNz2mWXz20nRD:
> to=<[hidden email]>, relay=10.0.100.5[10.0.100.5]:24, conn_use=29,
> delay=0.43, delays=0/0/0/0.42, dsn=2.0.0, status=sent (250 2.0.0
> <[hidden email]> 6KKUF0PhdF6eAgAA5fQimA Saved)
>
> *total delay to amavis delay=33

This message spent very little time in the after-filter queue.

The other examples are the same, they wait less time for a before-filter
SMTP client process to become available, otherwise I see no significant
difference.

        Wietse