Marcin Orlowski | 2 Sep 2011 20:34
Picon

Long delay on connection (before SMTP prompt appear)

hi,

I got odd issue with one of my smtp box  and I got some problems
finding the culprit out. The problem is that it takes
ages for smptd prompt to appear:

# telnet localhost 25
Trying 127.0.0.1...
[... wait, wait, wait ...]
Connected to localhost.
Escape character is '^]'.
220 Welcome to mail delivery server ESMTP

The wait time vary but is often 60+ secs, so MUA with default 60 secs 
timeout complain.

All is started that way:

${TCPSERVER} -v -l ${HOSTNAME} -H -R -c 500 -u 1004 -g 1003 0 smtp 
${SPAMDYKE} ${SMTPD} ${MYNAME} ${CHECKPASSSMTP} /bin/true 2>&1 | cat 
/dev/null &

(Variables are fine), my name is `hostname` output and resolves both 
ways. Sometimes (frequently enough to not ignore it) I also see
max number of instances of app invoked by tcpserver (usually
503) but at the same time the log does not indicate such
increase of traffic (usually there are 30-40).  At the same time there's 
said delay, launching ./qmail-smtp by hand shows no delay, so I suspect 
tcpserver or spamdyke steps (or something they relay on). My first guess 
was dns, but there's caching dns running locally plus I disabled 
(Continue reading)

Eric Shubert | 2 Sep 2011 21:00
Favicon

Re: Long delay on connection (before SMTP prompt appear)

On 09/02/2011 11:34 AM, Marcin Orlowski wrote:
> hi,
>
> I got odd issue with one of my smtp box  and I got some problems
> finding the culprit out. The problem is that it takes
> ages for smptd prompt to appear:
>
> # telnet localhost 25
> Trying 127.0.0.1...
> [... wait, wait, wait ...]
> Connected to localhost.
> Escape character is '^]'.
> 220 Welcome to mail delivery server ESMTP
>
> The wait time vary but is often 60+ secs, so MUA with default 60 secs
> timeout complain.
>
> All is started that way:
>
> ${TCPSERVER} -v -l ${HOSTNAME} -H -R -c 500 -u 1004 -g 1003 0 smtp
> ${SPAMDYKE} ${SMTPD} ${MYNAME} ${CHECKPASSSMTP} /bin/true 2>&1 | cat
> /dev/null&
>
> (Variables are fine), my name is `hostname` output and resolves both
> ways. Sometimes (frequently enough to not ignore it) I also see
> max number of instances of app invoked by tcpserver (usually
> 503) but at the same time the log does not indicate such
> increase of traffic (usually there are 30-40).  At the same time there's
> said delay, launching ./qmail-smtp by hand shows no delay, so I suspect
> tcpserver or spamdyke steps (or something they relay on). My first guess
(Continue reading)

Marcin Orlowski | 2 Sep 2011 22:52
Picon

Re: Long delay on connection (before SMTP prompt appear)

On Fri, 02 Sep 2011 12:00:19 -0700, Eric Shubert <ejs@...> wrote:

> I'd suspect DNS as well. Did you double check your /etc/resolv.conf 
> file, and be sure that dns requests are handled locally?

resolv.conf is just "nameserver 127.0.0.1" and pdns does its job.
The trick is that I recall I installed pdns on that box locally 
after I started noticing this problem. But it also started to appear
with new spam big spam wave.

Regards,
--

-- 
 "Daddy, what "Formatting drive C:" means?"...

 Marcin                       http://wfmh.org.pl/carlos/
Michael J. Colvin | 2 Sep 2011 21:08
Favicon

Re: Long delay on connection (before SMTP prompt appear)

If it is *ALWAYS* the same amount of time, I'd look at the Greeting Delay
(OR whatever it's called) in SpamDyke, or something similar.

If it varies, and increases during peak times, I'd suspect a resource
issue...Concurrent connections maxed out, SMTP connections maxed, etc...  If
you look at the MRTG graphs that are part of the QMT package, you can
usually easily see when you've got a connection limitation.  The graph will
peak up and flatline, then drop down again.

Mike

-----Original Message-----
From: spamdyke-users-bounces@...
[mailto:spamdyke-users-bounces@...] On Behalf Of Marcin Orlowski
Sent: Friday, September 02, 2011 11:34 AM
To: spamdyke-users@...
Subject: [spamdyke-users] Long delay on connection (before SMTP prompt
appear)

hi,

I got odd issue with one of my smtp box  and I got some problems
finding the culprit out. The problem is that it takes
ages for smptd prompt to appear:

# telnet localhost 25
Trying 127.0.0.1...
[... wait, wait, wait ...]
Connected to localhost.
Escape character is '^]'.
(Continue reading)

Marcin Orlowski | 2 Sep 2011 23:16
Picon

Re: Long delay on connection (before SMTP prompt appear)

On Fri, 2 Sep 2011 12:08:07 -0700, "Michael J. Colvin"
<mcolvin@...> wrote:
> If it is *ALWAYS* the same amount of time, I'd look at the Greeting
Delay
> (OR whatever it's called) in SpamDyke, or something similar.

No it varies. I can be even instant from time to time but in general
there is a delay

> If it varies, and increases during peak times, I'd suspect a resource
> issue...Concurrent connections maxed out, SMTP connections maxed, etc...

> If
> you look at the MRTG graphs that are part of the QMT package, you can
> usually easily see when you've got a connection limitation.  The graph
will
> peak up and flatline, then drop down again.

I do not use QMT, but I suspect that problem occurs before qmail and 
either tcpserver or spamdyke does something that triggers the issue.
But I at the moment got empty head where to peek next. I even started
checking all these /proc/sys/fs and /proc/sys/net values looking
for something that may be too low.

If anyone got idea or suggestion where to peek or what type of test 
I should execute to push this forward I am all ears and willing.

Thanks for all the feedback guys.

Regards,
(Continue reading)

Marcin Orlowski | 2 Sep 2011 23:19
Picon

Re: Long delay on connection (before SMTP prompt appear)

On Fri, 2 Sep 2011 12:08:07 -0700, "Michael J. Colvin"
<mcolvin@...> wrote:
> If it is *ALWAYS* the same amount of time, I'd look at the Greeting
Delay
> (OR whatever it's called) in SpamDyke, or something similar.

No it varies. I can be even instant from time to time but in general
there is a delay

> If it varies, and increases during peak times, I'd suspect a resource
> issue...Concurrent connections maxed out, SMTP connections maxed, etc...

> If
> you look at the MRTG graphs that are part of the QMT package, you can
> usually easily see when you've got a connection limitation.  The graph
will
> peak up and flatline, then drop down again.

I do not use QMT, but I suspect that problem occurs before qmail and 
either tcpserver or spamdyke does something that triggers the issue.
But I at the moment got empty head where to peek next. I even started
checking all these /proc/sys/fs and /proc/sys/net values looking
for something that may be too low.

If anyone got idea or suggestion where to peek or what type of test 
I should execute to push this forward I am all ears and willing.

Thanks for all the feedback guys.

Regards,
(Continue reading)

trog | 5 Sep 2011 12:14

Re: Long delay on connection (before SMTP prompt appear)

Quoting Marcin Orlowski <carlos@...>:

>
> Sometimes (frequently enough to not ignore it) I also see
> max number of instances of app invoked by tcpserver (usually
> 503) but at the same time the log does not indicate such
> increase of traffic (usually there are 30-40).  At the same time there's
> said delay, launching ./qmail-smtp by hand shows no delay, so I suspect
> tcpserver or spamdyke steps (or something they relay on).

This is probably the problem then. When tcpserver reaches the limit of  
simultaneous connections (-c 500 in your case), it will behave as  
described, i.e. it will not start a new instance of qmail-smtpd until  
an existing connection closes.

Use netstat to find out what all the open connections are, and where  
they are connecting from.

-trog

Gmane