A
A
alexan2017-02-15 18:07:56
FreeBSD
alexan, 2017-02-15 18:07:56

Listen queue overflow in FreeBSD when mailing. Where to twist?

It goes like this.
Dedicated server. PHP script makes a small mailing list, 1000-2000 emails. At the same time, for some reason, the system queue for pickup (an auxiliary service for Postfix) gets clogged:

netstat -Lan
...
unix  151/0/100        public/pickup
...

and the system complains:
kernel: sonewconn: pcb 0xfffff8004cbbf870: Listen queue overflow: 151 already in queue awaiting acceptance
last message repeated 972 times

The letters themselves seem to go away, there are no errors in the logs, but there is something like the following:
Feb 15 17:01:02 theserver postfix/pickup[29787]: 7627929DE4A5: uid=1001 from=<theuser>
Feb 15 17:01:02 theserver postfix/cleanup[33164]: 7627929DE4A5: message-id=<[email protected]>
Feb 15 18:01:02 theserver opendkim[972]: 7627929DE4A5: DKIM-Signature field added (s=thedomen, d=thedomen.ru)
Feb 15 17:01:02 theserver postfix/qmgr[81797]: 7627929DE4A5: from=<[email protected]>, size=1811, nrcpt=1 (queue active)
Feb 15 17:01:03 theserver postfix/smtp[33168]: 7627929DE4A5: to=<[email protected]>, relay=mx.yandex.ru[87.250.250.89]:25, conn_use=11, delay=58, delays=57/0/0/0.61, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued on mxfront3j.mail.yandex.net as 1487167263-xPE7azV17j-12jSJTiT)
Feb 15 17:01:03 theserver postfix/qmgr[81797]: 7627929DE4A5: removed

..but who knows what happens if the input queue is already full. Maybe the system just discards letters and they do not get into the queue?
A reasonable increase in the queue size does not bring results.
The postfix config does not contain anything special, its differences from the pure installation config are something like this:
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination, check_recipient_access hash:/usr/local/etc/postfix/access

# Запрещение приёма почты с некоторых адресов
smtpd_sender_restrictions = hash:/usr/local/etc/postfix/incoming_access

smtpd_banner = $myhostname ESMTP

local_recipient_maps = hash:/usr/local/etc/postfix/recipient_map $alias_maps

# DKIM
smtpd_milters = inet:127.0.0.1:8891
non_smtpd_milters = $smtpd_milters
milter_default_action = accept

Where to dig?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
athacker, 2017-02-16
@alexan

This is not a queue of mail, but of incoming TCP connections. Stupid your pickup, does not have time to process new connections. Put a pause in the script that sends letters, let it not send all 1000 at once, but 100 at a time. Or look, because of what pickup can be stupid. Maybe the disk load is high. Maybe there is not enough memory and it swaps constantly.

A
Alexander Chernykh, 2017-02-15
@sashkets

in which line give
sysctl kern.ipc.somaxconn

M
Max Kostikov, 2017-02-18
@mxms

Set kern.ipc.soacceptqueue to a value greater than the current value in sysctl.conf.
Old setting
deprecated

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question