Knowledge base

max-size

<acct-file>set by the Hub

The maximum size of an accounting file or a webhook batch
in the configuration this is a linemax-size 250M for files, 5M for webhooksinside the block <acct-file>
One ceiling, two different meanings

The line means different things depending on where accounting goes, and that is its main peculiarity.

For a file it is the ceiling at which the engine closes the file and starts a new one. The default is 250M, the minimum is 1M. It works without move-to too: then the new file starts in place, with an incremented number in its name.

For a webhook it is the maximum size of a batch. The default is 5M, the minimum 50K, the ceiling 10M.

This is the second closing condition, working together with move-interval for a file and with http-webhook-max-interval for a webhook: whichever comes first fires.

The main trap is carrying a value over from a file block to a webhook block. Their limits differ: for a file 250M is the default, while for a webhook it cannot be set at all — the ceiling there is 10M. And vice versa, 50K is below the minimum for a file.
What the Hub does. It writes it — and differently in two blocks.

In the file block it is max-size 25M, ten times smaller than the vendor default. That makes sense: we have no move-to, the file starts anew in place, and small files are easier to parse.

In the telemetry block it is max-size 1M, five times smaller than the vendor’s 5M for a webhook. That makes sense too: one-minute batches are small anyway, and our receiver rejects a body larger than 32 MB with a 413 response, so the margin is thirtyfold.

Recommended values

The value depends on the stream type:

Stream Minimum Default Ceiling
file 1M 250M not stated
webhook 50K 5M 10M

The meaning differs too: for a file it is the point where the next one begins, for a webhook — the maximum volume of one request.

Both defaults, the minimums, the webhook ceiling and the behavior without move-to come from the manual (§ 3.3.11.4). The breakdown of our values follows the Hub template.
Example configuration
# file: a new one starts in place when the ceiling is reached
<acct-file /var/log/pmta/acct.csv>
    max-size 25M    delete-after 7d
</acct-file>

# webhook: the same key means the maximum batch size
<acct-file /var/log/pmta/mtahub-webhook.json>
    http-webhook-url https://hub.example.com/api/telemetry/pmta/7
    http-webhook-max-interval 1m
    max-size 1M
</acct-file>
One and the same line, two different meanings and two different ranges of allowed values.
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 ends2 mistakes▶

Carrying a file value over to a webhook block

§ 3.3.11.4

What it costsThe ranges differ: a webhook has a 10M ceiling, and a value like 250M does not fit there. The configuration either fails validation or the value gets capped.
How to spot itpmta test config complains about the value, or batches go out smaller than set.
How to do it rightKeep two scales in mind: a file from 1M, a webhook from 50K to 10M.

Setting a large ceiling with moving turned off

our experience

What it costsWithout move-to a new file starts in place, and very large files pile up in the directory. They are inconvenient to parse and move, and deletion by age cuts off a big chunk of history at once.
How to spot itThe directory holds several files of a hundred megabytes each.
How to do it rightLower the ceiling — small files are easier both to parse and to delete by age.
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
max-size <size>
Values
N with a multiplier b, k, m, g or t
Default
250M for files, 5M for webhooks § 3.3.11.4
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
There is no inheritance: the line lives inside its <acct-file> and applies to its stream — and its meaning is determined by whether that stream is a file or a webhook.
How to check on the node
For a file the ceiling is visible from the size of closed files:
ls -la /var/log/pmta/acct*.csv
Closed files should be close to the set ceiling. For a webhook the same is checked on intermediate files — they are sent by size or by interval, whichever comes first.
In the Hub
Managed at
Analytics → Node accounting
Value
The Hub picks it itself — pace, warm-up stage, metrics
Cost of a mistake
reversible: harms only while it is set
Scenarios
Collect telemetry