Global
The engine tracks how much physical memory its own process has taken. As soon as the share goes over the set one, receiving new mail stops — right at the MAIL FROM stage, with the response 452 4.3.2 Server resources temporarily exhausted. When memory is freed, receiving resumes by itself: neither a restart nor a command is needed for that.
The refusal is temporary, and that is the whole point. 452 is not a rejection of the message but a request to retry: the submitting system must try again, not throw the message away. So the valve loses nothing — it only holds back the input.
The input is shut off, not the output. Everything already in the queue keeps going out: the directive does not touch delivery. That is by design — the queue drains, memory is freed, receiving opens back up. This is also how to recognize this 452: it reaches your sending platform at submission time, not from the recipient’s mailbox, and it has to be looked for in the submission log, not among delivery bounces.
What happens without the valve. A node with a growing queue runs into the operating system’s memory, and from there the system decides: on Linux the kernel kills the most memory-hungry process, and that is the engine itself, pmtad. The watchdog pmtawatch will bring it back up, but whatever was received and not written is lost, and after startup the node also rereads the whole spool, loading the queue into memory again — minutes during which it does not send.
Count not the percentage but what is left. The threshold is the reserve you leave for everything else: the kernel, logs, the disk cache, and on a shared server the neighbors too. The same percentage on different nodes leaves a different reserve, so the less memory there is, the lower the threshold should be.
As a guide, leave the system between half a gigabyte and one and a half: with 2 GB that is 70, with 4 GB — 80, with 8 GB — 85, with 16 GB or more — 90, the very default of version five.
Do not go below 60. A threshold that triggers under normal load turns an emergency refusal into a permanent one: the platform gets 452 all day and sooner or later considers the node dead. The valve should trigger rarely — it is the last line, not a way to control the rate. The rate is controlled by max-msg-rate and total-max-smtp-out, the queue volume by spool-max-recipients, and those should be dealt with first.
A hundred makes sense only where memory is limited from outside — by a container or cgroup limit — and you consciously hand the decision over there. In other cases it is not “without limits” but “without a safety net.”
# node-level directives are written at the root of the file, without an enclosing block total-max-smtp-in 1000 total-max-smtp-out 5000 # emergency valve: on a 4 GB node the system keeps about 800 MB max-memory-usage-percent 80
what people get wrong and how it ends3 mistakes▶
§ 3.3.1.50
our experience
our experience
2 relations
grep -rn max-memory-usage-percent /etc/pmta/ ps -o pid,rss,%mem,comm -C pmtad
3 articles
◇What makes a virtual machine riskyRunning on a virtual machine is possible, but the manual does not recommend it without sufficient hardware and properly tuned hypervisor settings: under load the node may stop responding.◇The activation key is a prerequisite for installation, not a step after itWithout an activation key from SparkPost support the engine neither installs nor runs, and the license tier sets the outbound connection ceiling: on Standard everything above 200 is ignored.◇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.