Knowledge base

http-webhook-connect-timeout

<acct-file>

How long to wait for a connection to the receiver to be established
in the configuration this is a linehttp-webhook-connect-timeout 5sinside the block <acct-file>
Getting through to the receiver

The line limits only connection establishment — from the start of the connection until it is ready to talk. The default is 5s.

Five seconds is a lot for a healthy network and little for a sick one. A receiver in the same data center answers in milliseconds; a receiver across an ocean with packet loss may not make it, and then the batch goes into a retry.

An expired wait is not a loss. The batch stays in the intermediate file and will be sent again. The price is data delay and a pile-up of files if this happens constantly.

The second half of the pair is http-webhook-io-timeout: it limits the conversation itself, and its default is the same.

The main trap is increasing the wait instead of investigating the network. If connecting takes more than five seconds, the problem is usually not the threshold but the route, name resolution or an overloaded receiver. A raised threshold hides the symptom and leaves the cause.
What the Hub does. It does not write it — the default stays. Our receiver sits behind an ordinary web server and answers at once: it only checks the token and queues a job, while parsing happens in the background.

The line will come in handy if a node is far away and the network to the Hub is not stable enough.

Recommended values

Increase it only with a measurement in hand:

Value When
5s (default) always
up to 30s the node is far away, the network is lossy, measured

Check with the same thing the engine uses to connect — an ordinary connection to the receiver’s address.

The 5s default and the fact that the threshold concerns only connecting come from the manual (§ 3.3.11.24). The advice to investigate the network instead of raising the threshold is ours.
Example configuration
# the node is far away, connecting takes measurably long
<acct-file /var/log/pmta/webhook.json>
    http-webhook-url https://hub.example.com/api/telemetry/pmta/7
    http-webhook-connect-timeout 15s</acct-file>
The value is set by measurement, not by eye. A connection that constantly fails to make it in time is a reason to investigate the network, not to raise the threshold.
yellow — — directive names, blue — blocks. They are highlighted the same way in the text of the card.
▲

Common mistakes and problems

what people get wrong and how it ends1 mistake▶

Raising the threshold, mistaking a receiver refusal for a slow network

our experience

What it costsThe symptom is the same — files pile up. But if the receiver does not reply 2xx, the threshold has nothing to do with it, and raising it will change nothing.
How to spot itThe threshold was raised, and the pile-up continues.
How to do it rightEnable http-webhook-log-verbose and see whether things get as far as a reply.
Compatibility
PowerMTA 6.0
described in the manual of this version · platform: any
The vendor does not state the first version for every directive — there is no note here. The name also appears in the 5.0 edition of the manual.
Reference data
Syntax
http-webhook-connect-timeout <time-interval>
Values
a time interval
Default
5s § 3.3.11.24
Applying
reload, no restart needed
Queue
will not touch what is already queued
Where to write it
<acct-file>
How many times
once in the block
Everything here comes from the manual, with the section.
Inheritance
No inheritance: the line lives inside its own <acct-file> and concerns connections to only its receiver. Different accounting streams have different receivers, and their thresholds may differ.
How to check on the node
We measure the same thing the engine measures — connection establishment time:
curl -s -o /dev/null -w 'connect=%{time_connect} total=%{time_total}\n' https://hub.example.com/
time_connect is exactly what this line limits. A value noticeably below the threshold means the threshold is not the problem.
In the Hub
Cost of a mistake
reversible: harms only while it is set
Scenarios
Collect telemetry