How do you keep core dumps from filling disks while still capturing them?
AdvancedProductionLogs, Limits & High-Traffic Tuning
Answer
Use systemd-coredump with size limits:
# /etc/systemd/coredump.conf.d/limits.conf
[Coredump]
Storage=external
Compress=yes
ProcessSizeMax=2G
ExternalSizeMax=2G
MaxUse=10G
coredumpctl list
coredumpctl info <pid>
coredumpctl debug <pid> # opens gdb
Core dumps can contain secrets from memory, so restrict access, and disable them on hosts handling sensitive data (fs.suid_dumpable=0, * hard core 0).
More on Logs, Limits & High-Traffic Tuning
How does log management work on a modern Linux server?BeginnerWhy centralize logs instead of reading them on each server?BeginnerWrite a logrotate config for an application log.BeginnerWhat is the difference between `copytruncate` and `create` + postrotate signal?IntermediateLogs rotated but disk usage did not drop. Why?IntermediateHow often does logrotate run, and why does `maxsize` sometimes not trigger in time?Intermediate