<acct-file>
The line enables compression of the content before sending. One value is supported — gzip, and by default there is no compression.
Accounting records compress very well. This is text with repeating field names: NDJSON repeats them in every line, CSV — in the header, but the values themselves are uniform. The gain on such material is usually several-fold.
The receiver must be able to decompress. The engine sets the header itself, but if the receiving side does not look at it, it gets an incomprehensible binary stream. A receiver that parses the body before replying will not answer 2xx — and the sending goes into a retry; a receiver that replies at once will accept the batch and lose it while parsing.
This is the first thing worth trying in a conversation about volume — before increasing the interval and before parallelization.
It is worse if the receiver replies before parsing the body: it will say 2xx, there will be no retry, and the batches will be lost silently.
🔎 Worth a try, though. Every node of the fleet sends five record types once a minute — with the full default field set plus additions (record-fields d *,timeFirstAttempt,… and so on). This is the most compressible material there is, and compression would noticeably cut traffic from the nodes to the Hub.
🔴 But first — decompression in the receiver. There is none now, and Laravel does not decompress a body with Content-Encoding: gzip by itself. And there will be no retry: our receiver replies 2xx without looking into the body, background parsing will not find a single JSON line in the batch — and the records will be lost, leaving a trace only in the telemetry intake error counter.
One value, the only question is “enable or not”:
| Value | When |
|---|---|
| not set (default) | the receiver cannot decompress |
| gzip | it can — then always |
Check the receiver, not the node: the engine compresses and labels by itself.
# the cheapest saving: enabled with one line <acct-file /var/log/pmta/webhook.json> http-webhook-url https://hub.example.com/api/telemetry/pmta/7 http-webhook-transfer-encoding gzip</acct-file>
what people get wrong and how it ends2 mistakes▶
our experience
§ 3.3.11.22
1 relation
curl -s -o /dev/null -w '%{http_code}\n' -X POST -H 'Content-Encoding: gzip' -H 'Content-Type: application/x-ndjson' --data-binary @batch.json.gz URL
3 articles
◇What the node tells about itself and through which channelsSeven observation surfaces: the web monitor, the console in four formats, the log, accounting, accounting search, metrics and export to external analytics.◇Two inbound report processors and what to do with themBounces by message and complaints are parsed by two identically structured blocks; each has its own address list and its own pair of decisions about the message’s fate.◇Five ways for a queue to hand off a messageA queue does not have to use SMTP: it can write to a file, run a program, call over HTTP or discard.