Re: [exim] smtp back off on queue size?

Etusivu
Poista viesti
Vastaa
Lähettäjä: Ian Eiloart
Päiväys:  
Vastaanottaja: Users Users
Aihe: Re: [exim] smtp back off on queue size?

On 29 Oct 2013, at 17:17, Viktor Dukhovni <exim-users@???> wrote:

> On Tue, Oct 29, 2013 at 05:01:05PM +0000, Jeremy Harris wrote:
>
>> On 29/10/13 16:19, Osborne, Paul (paul.osborne@???) wrote:
>>> I have checked through the manual for the version we are running 4.72
>>> (Debian - squeeze) and cannot see an option like:
>>>
>>> smtp_queue_size_backoff
>>>
>>> Where Exim does not respond to SMTP if there are X no of mails in its own
>>> queue waiting to be processed.
>>>
>>> Is there such an option, if so what is it? If there is not can I add it
>>> as a feature request? :)
>>
>> RFEs can always be opened at http://bugs.exim.org/
>> For your immediate needs, I'd suggest putting some custom stuff onto
>> your smtp connect ACL, involving a ${run } expansion to evaluate
>> the queue size.
>
> With a cache of the count that is updated periodically, rather than
> every time it is queried. Scanning the queue counting messages
> can be I/O intensive.


On my machines, `ls /var/spool/exim/input |wc -l` is about an order of magnitude faster than `exiqgrep -c`.

The latter takes about half a second for a queue of 1000 or so items. Of course, `ls` reports double the number, since there are two files for every queued item.

% time exiqgrep -c
1259 matches out of 1259 messages

real    0m4.625s
user    0m0.160s
sys    0m0.186s


% time ls input/ |wc -l
    3020


real    0m0.647s
user    0m0.006s
sys    0m0.043s




> You don't want to do that on every incoming
> SMTP request. You probably also want a high/low watermark strategy
> so that once the count exceeds the high mark, the throttling
> continues until it drops below the low mark.
>
> Such back-pressure tuning can be tricky. The queue can be large
> in steady state with deferred mail to a destination that is down,
> while other destinations are just fine, and you may not want to
> stop accepting mail generally. When all mail is queued for the
> same resource (e.g. waiting to be scanned), that's a more easy case
> to deal with.
>
> -- 
>     Viktor.

>
> --
> ## List details at https://lists.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://wiki.exim.org/


--
Ian Eiloart
Postmaster, University of Sussex
+44 (0) 1273 87-3148