Mail queue with 110.000 mails

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Mail queue with 110.000 mails

Roberto Carna
Dear, yesterday I realized that the mail queue of my SMTP relay server
is about 110.000 mails, and the warning log file tell me:

Mar 20 10:00:08 RELAY1 postfix/qmgr[55666]: warning: mail for
[10.0.0.1] is using up 20000 of 20000 active queue entries

Mar 20 10:00:09 RELAY1 postfix/qmgr[55666]: warning: you may need to
increase the main.cf smtp_destination_concurrency_limit from 20

Mar 20 10:00:10 RELAY1 postfix/qmgr[55666]: warning: please avoid
flushing the whole queue when you have

Mar 20 10:00:10 RELAY1 postfix/qmgr[55666]: warning: lots of deferred
mail, that is bad for performance

Mar 20 10:00:12 RELAY1 postfix/qmgr[55666]: warning: to turn off these
warnings specify: qmgr_clog_warn_time = 0

I have setup port TCP/25 (SMTP) and port TCP/587 (STARTTLS), both listening OK.

I have a transport option in order to send all the internal mail
through the corporate mail server.

What do I have to do in order to tune the queue performance and so put
to work again the mail service???

Thanks in advance to you.

Roberto
Reply | Threaded
Open this post in threaded view
|

RE: Mail queue with 110.000 mails

angelo
Hi,
Use postqueue -p   to look at what is in the queue.
Use postsuper -h to move stuff to look at later.

Read man pages of those commands if needed.
-ALF

-Angelo Fazzina
Operating Systems Programmer / Analyst
University of Connecticut,  UITS, SSG, Server Systems
860-486-9075


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Roberto Carna
Sent: Monday, March 27, 2017 2:28 PM
To: [hidden email]
Subject: Mail queue with 110.000 mails

Dear, yesterday I realized that the mail queue of my SMTP relay server
is about 110.000 mails, and the warning log file tell me:

Mar 20 10:00:08 RELAY1 postfix/qmgr[55666]: warning: mail for
[10.0.0.1] is using up 20000 of 20000 active queue entries

Mar 20 10:00:09 RELAY1 postfix/qmgr[55666]: warning: you may need to
increase the main.cf smtp_destination_concurrency_limit from 20

Mar 20 10:00:10 RELAY1 postfix/qmgr[55666]: warning: please avoid
flushing the whole queue when you have

Mar 20 10:00:10 RELAY1 postfix/qmgr[55666]: warning: lots of deferred
mail, that is bad for performance

Mar 20 10:00:12 RELAY1 postfix/qmgr[55666]: warning: to turn off these
warnings specify: qmgr_clog_warn_time = 0

I have setup port TCP/25 (SMTP) and port TCP/587 (STARTTLS), both listening OK.

I have a transport option in order to send all the internal mail
through the corporate mail server.

What do I have to do in order to tune the queue performance and so put
to work again the mail service???

Thanks in advance to you.

Roberto
Reply | Threaded
Open this post in threaded view
|

Re: Mail queue with 110.000 mails

chaouche yacine
In reply to this post by Roberto Carna
Hello,

I am curious to know why do you have 110 000 mails in the mail queue to begin with ? are they all deferred mail ? and if so, can you report the log line that could contian the reason of the defer ?


It happened to me once when I have (mis)configured quotas for my users. When a user was over quota, postfix kept retrying again again instead of bouncing the mail. The problem is that the user had a filter that forwraded the mail to another mailbox, so each delivery attempt by postfix was also forwarded to another mailbox and that other mailbox eventually got over quota too. In addition, some e-mails were sent from a non existing address (a fake address used by scripts or windows apps) and the over quota bounce e-mails to those addresses also got deferred ! I ended up having 18 000 mails in the active queue and 35000 in the deferred queue. And above all, a colleague has flushed the queue, making the performances even worse...


  -- Yassine.
Reply | Threaded
Open this post in threaded view
|

Re: Mail queue with 110.000 mails

Viktor Dukhovni
In reply to this post by Roberto Carna

> On Mar 27, 2017, at 2:27 PM, Roberto Carna <[hidden email]> wrote:
>
> Dear, yesterday I realized that the mail queue of my SMTP relay server
> is about 110.000 mails,

   http://www.postfix.org/QSHAPE_README.html

> and the warning log file tell me:
>
> Mar 20 10:00:08 RELAY1 postfix/qmgr[55666]: warning: mail for
> [10.0.0.1] is using up 20000 of 20000 active queue entries

The relay at 10.0.0.1 is not able to process your mail quickly
enough.  See QSHAPE_README and try to find out why from your logs.

--
        Viktor.

Reply | Threaded
Open this post in threaded view
|

Re: Mail queue with 110.000 mails

Geert Stappers
In reply to this post by chaouche yacine
On Mon, Mar 27, 2017 at 06:45:05PM +0000, chaouche yacine wrote:

> Hello,
>
> I am curious to know why do you have 110 000 mails in the mail queue
> to begin with ? are they all deferred mail ? and if so, can you report
> the log line that could contian the reason of the defer ?
>
>
> It happened to me once when I have (mis)configured quotas for my
> users. When a user was over quota, postfix kept retrying again again
> instead of bouncing the mail. The problem is that the user had a filter
> that forwraded the mail to another mailbox, so each delivery attempt
> by postfix was also forwarded to another mailbox and that other mailbox
> eventually got over quota too. In addition, some e-mails were sent from
> a non existing address (a fake address used by scripts or windows apps)
> and the over quota bounce e-mails to those addresses also got deferred
> ! I ended up having 18 000 mails in the active queue and 35000 in
> the deferred queue. And above all, a colleague has flushed the queue,
> making the performances even worse...
>

Use `postsuper` to delete from the mail queue.

On recent Postfix versions, you should this in the manual page `postsuper`

          mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" }
              # $7=sender, $8=recipient1, $9=recipient2
              { if ($8 == "[hidden email]" && $9 == "")
                    print $1 }
              ' | tr -d '*!' | postsuper -d -


Groeten
Geert Stappers
--
Leven en laten leven
Reply | Threaded
Open this post in threaded view
|

Re: Mail queue with 110.000 mails

Alejandro Cabrera Obed-2
In reply to this post by Viktor Dukhovni
Dear, thanks....is it possible that the STARTTLS settings slow down mail processing? In this mail relay server, the connections as "client" to the corporate mail server are always encrypted with the TLS, with the corresponding negotiation.

Thanks and I will analyze all you said.

Thanks to all.

Roberto

2017-03-27 15:56 GMT-03:00 Viktor Dukhovni <[hidden email]>:

> On Mar 27, 2017, at 2:27 PM, Roberto Carna <[hidden email]> wrote:
>
> Dear, yesterday I realized that the mail queue of my SMTP relay server
> is about 110.000 mails,

   http://www.postfix.org/QSHAPE_README.html

> and the warning log file tell me:
>
> Mar 20 10:00:08 RELAY1 postfix/qmgr[55666]: warning: mail for
> [10.0.0.1] is using up 20000 of 20000 active queue entries

The relay at 10.0.0.1 is not able to process your mail quickly
enough.  See QSHAPE_README and try to find out why from your logs.

--
        Viktor.




--
 //  Alejandro   //



Reply | Threaded
Open this post in threaded view
|

Re: Mail queue with 110.000 mails

Viktor Dukhovni

> On Mar 27, 2017, at 3:06 PM, Alejandro Cabrera Obed <[hidden email]> wrote:
>
> Dear, thanks....is it possible that the STARTTLS settings slow down mail processing? In this mail relay server, the connections as "client" to the corporate mail server are always encrypted with the TLS, with the corresponding negotiation.

TLS is not generally a major source of latency.  The issue is more
likely delays in PTR lookups of the client's IP by the server, or
excessive load on the server.  Of misconfigured synchronous logging
on the client, ...  See QSHAPE_README.

--
        Viktor.

Reply | Threaded
Open this post in threaded view
|

Re: Mail queue with 110.000 mails

ktm@rice.edu
In reply to this post by Alejandro Cabrera Obed-2
On Mon, Mar 27, 2017 at 04:06:46PM -0300, Alejandro Cabrera Obed wrote:

> Dear, thanks....is it possible that the STARTTLS settings slow down mail
> processing? In this mail relay server, the connections as "client" to the
> corporate mail server are always encrypted with the TLS, with the
> corresponding negotiation.
>
> Thanks and I will analyze all you said.
>
> Thanks to all.
>
> Roberto

Hi Roberto,

If you have a shortage of entropy, and you require it for your random
number source, it can slow TLS connections. The typical solution is
to use either a pseudo-random source or a hw-based entropy source.

Regards,
Ken
Reply | Threaded
Open this post in threaded view
|

Re: Mail queue with 110.000 mails

Roberto Carna
So should we use this setting for TLS options in main.cf in order to
slow down the key generation time:

tls_random_source = dev:/dev/urandom

???


Thanks again.

2017-03-27 16:30 GMT-03:00 Kenneth Marshall <[hidden email]>:

> On Mon, Mar 27, 2017 at 04:06:46PM -0300, Alejandro Cabrera Obed wrote:
>> Dear, thanks....is it possible that the STARTTLS settings slow down mail
>> processing? In this mail relay server, the connections as "client" to the
>> corporate mail server are always encrypted with the TLS, with the
>> corresponding negotiation.
>>
>> Thanks and I will analyze all you said.
>>
>> Thanks to all.
>>
>> Roberto
>
> Hi Roberto,
>
> If you have a shortage of entropy, and you require it for your random
> number source, it can slow TLS connections. The typical solution is
> to use either a pseudo-random source or a hw-based entropy source.
>
> Regards,
> Ken
Reply | Threaded
Open this post in threaded view
|

Re: Mail queue with 110.000 mails

ktm@rice.edu
On Mon, Mar 27, 2017 at 04:55:46PM -0300, Roberto Carna wrote:
> So should we use this setting for TLS options in main.cf in order to
> slow down the key generation time:
>
> tls_random_source = dev:/dev/urandom
>
> ???
>
>
> Thanks again.

Yes, that is what we use here.

Regards,
Ken
Reply | Threaded
Open this post in threaded view
|

Re: Mail queue with 110.000 mails

Viktor Dukhovni
In reply to this post by ktm@rice.edu

> On Mar 27, 2017, at 3:30 PM, Kenneth Marshall <[hidden email]> wrote:
>
> If you have a shortage of entropy, and you require it for your random
> number source, it can slow TLS connections. The typical solution is
> to use either a pseudo-random source or a hw-based entropy source.

Not in Postfix.  Postfix uses /dev/urandom, and even that rather
intermittently.  It is possible, but highly unlikely, that the remote
server's problem is a slow entropy source.  I'd rule out more likely
issues first.

--
        Viktor.