๐ Daftar Isi
- The Raw Log: What Actually Happened?
- Lines 1-5: Signal 15 (SIGTERM) โ The Graceful Kill
- Lines 6-8: Signal 9 (SIGKILL) โ The Forced Kill
- Lines 9-10: Netdata OOM Protection
- Why Were Netdata Plugins the Victims?
- Impact on VPS Instances Running on This Node
- 1. VPS Monitoring Goes Dark Temporarily
- 2. VPS Instances Are NOT Directly Affected (Luckily)
- 3. Future Risk Is Elevated
- 4. VPS Performance May Degrade
- Troubleshooting: Commands You Need to Run
- Root Cause: Why Did RAM Run Out?
- Solutions & Prevention
- 1. Optimize Netdata Memory Usage
- 2. Set OOM Score Adjustment for Critical Processes
- 3. Monitor RAM Usage Proactively
- 4. Cap RAM per VPS
- 5. Identify & Handle Overcommitting VPS
- Pro Tips from Experience
- FAQ
- Conclusion
You know that feeling when everything seems fine, and then a client messages you saying “hey, my website is down?” You check monitoring โ all green. Then you pull up the hardware node logs and see a bunch of lines mentioning “Out-Of-Memory” and “killed” everywhere. It’s like cooking dinner and suddenly the power goes out โ the stove is off, rice is half-cooked, veggies are raw, but you have no idea why. Was it a blown fuse? A grid outage? A tripped breaker?
I see this scenario all the time when managing dedicated servers that host multiple VPS instances. The logs look simple โ just a few lines of grep output. But behind those lines is a serious story about RAM exhaustion and the OS’s last-ditch effort to keep the system alive. This article breaks down exactly what happened in those OOM kill logs from a hardware node, and more importantly, what impact it has on the VPS instances running on top of it.
The Raw Log: What Actually Happened?
Let’s start with the logs you captured. This is the output from a grep command on the hardware node:
Jul 25 03:06:24 vm-server-32 spawn-plugins[2308522]: SPAWN SERVER: child with pid 2309738 (request 6) killed by signal 15: /bin/sh -c "exec /opt/netdata/usr/libexec/netdata/plugins.d/debugfs.plugin 1"
Jul 25 03:06:24 vm-server-32 spawn-plugins[2308522]: SPAWN SERVER: child with pid 2309758 (request 9) killed by signal 15: /bin/sh -c "exec /opt/netdata/usr/libexec/netdata/plugins.d/apps.plugin 1"
Jul 25 03:06:24 vm-server-32 spawn-plugins[2308522]: SPAWN SERVER: child with pid 2309775 (request 12) killed by signal 15: /bin/sh -c "exec /opt/netdata/usr/libexec/netdata/plugins.d/systemd-journal.plugin 1"
Jul 25 03:06:24 vm-server-32 spawn-plugins[2308522]: SPAWN SERVER: child with pid 2309807 (request 17) killed by signal 15: /bin/sh -c "exec /opt/netdata/usr/libexec/netdata/plugins.d/network-viewer.plugin 1"
Jul 25 03:06:24 vm-server-32 spawn-plugins[2308522]: SPAWN SERVER: child with pid 4189230 (request 8497) killed by signal 15: /bin/sh -c "exec /opt/netdata/usr/libexec/netdata/plugins.d/tc-qos-helper.sh 1"
Jul 25 03:06:24 vm-server-32 spawn-plugins[2308522]: SPAWN SERVER: child with pid 2309753 (request 8) killed by signal 9: /bin/sh -c "exec /opt/netdata/usr/libexec/netdata/plugins.d/go.d.plugin 1"
Jul 25 03:06:24 vm-server-32 spawn-plugins[2308522]: SPAWN SERVER: child with pid 2309781 (request 13) killed by signal 9: /bin/sh -c "exec /opt/netdata/usr/libexec/netdata/plugins.d/ebpf.plugin 1"
Jul 25 03:06:24 vm-server-32 spawn-plugins[2308522]: SPAWN SERVER: child with pid 2309725 (request 4) killed by signal 9: /bin/sh -c "exec /opt/netdata/usr/libexec/netdata/plugins.d/journal-viewer-plugin 1"
Jul 25 03:06:55 vm-tvi-32 netdata[104923]: Out-Of-Memory (OOM) score is already set to the wanted value 0
Jul 25 03:06:56 vm-tvi-32 netdata[104923]: DBENGINE memory protection enabled. Netdata will limit DBENGINE memory usage to help keep at least 5GiB of system RAM available when possible and reduce OOM risk. System memory total: 219.78GiB, currently available: 42.19GiB, use all RAM for caches: disabled
Now let’s break this down line by line.
Lines 1-5: Signal 15 (SIGTERM) โ The Graceful Kill
Five Netdata plugin processes were killed using signal 15 (SIGTERM). This is the OS’s polite way of asking a process to stop. Think of it as knocking on someone’s door โ “Excuse me, please vacate the premises.” The process gets time to clean up before it dies.
Plugins hit by SIGTERM:
- debugfs.plugin โ filesystem debugging
- apps.plugin โ per-application resource monitoring
- systemd-journal.plugin โ systemd journal log collection
- network-viewer.plugin โ network connection monitoring
- tc-qos-helper.sh โ traffic control and QoS management
Lines 6-8: Signal 9 (SIGKILL) โ The Forced Kill
Three other processes were killed using signal 9 (SIGKILL). This is the brutal version โ immediately terminated without mercy. Like kicking someone’s door down. The process can’t clean up, it’s just stopped dead. Signal 9 typically appears when a process refuses to die even after receiving SIGTERM.
Plugins hit by SIGKILL:
- go.d.plugin โ Go-based data collection module
- ebpf.plugin โ eBPF-based kernel monitoring
- journal-viewer-plugin โ log viewer
Lines 9-10: Netdata OOM Protection
This is the most critical part. Netdata detected that its OOM score was already set to 0 (meaning Netdata is protected from the OOM killer). But the last line is what really matters:
With RAM availability this tight, and Netdata enabling DBENGINE memory protection to keep at least 5GiB free, this situation clearly shows the hardware node is under heavy RAM pressure. And when RAM gets scarce, the OOM killer activates to terminate processes deemed “resource hogs.”
Why Were Netdata Plugins the Victims?
Great question. Why were the Netdata processes killed instead of VPS processes or other applications?
Here’s the thing โ Netdata runs at the host level (hardware node), not inside any VPS. It collects monitoring data from the entire system, including all VPS instances hosted on it. Netdata’s plugin processes are like “workers” assigned to gather data from various sources.
When RAM starts running low, the Linux OOM killer works by assigning a score to every process. The process with the highest OOM score becomes the first target. Some Netdata plugins are quite RAM-intensive โ especially go.d.plugin and ebpf.plugin running in memory-heavy mode.
Impact on VPS Instances Running on This Node
This is the most critical part. When the OOM killer activates on a hardware node, the impact on VPS instances varies significantly depending on the situation:
1. VPS Monitoring Goes Dark Temporarily
Because Netdata plugins were killed, monitoring data for all VPS instances on this node will have gaps for several minutes (until Netdata restarts its plugins). You won’t be able to see CPU usage, memory usage, disk I/O, or network traffic on your Netdata dashboard during this period.
2. VPS Instances Are NOT Directly Affected (Luckily)
In this specific case, what was killed were host-level Netdata processes, not processes running inside VPS instances. So the VPS instances hosted on this hardware node don’t directly crash or go down. They continue running normally. This is different from a scenario where the OOM killer targets VPS processes themselves.
3. Future Risk Is Elevated
This is an early warning sign. If RAM usage on the hardware node continues climbing without intervention, the next scenario could be much worse: the OOM killer starts targeting VPS processes, meaning services on those VPS instances could suddenly die โ websites go down, databases crash, applications error out.
4. VPS Performance May Degrade
When host RAM runs low, the operating system starts memory swapping โ moving data from RAM to disk (swap space). Disk swap is orders of magnitude slower than RAM, so the entire system (including VPS instances) could experience significant performance degradation.
Troubleshooting: Commands You Need to Run
After finding OOM kill logs on a hardware node, here are the steps you should take:
| Command | Purpose | Example Output |
|---|---|---|
|
Check current RAM usage | total: 220GiB, used: 178GiB, free: 42GiB |
|
Top 20 RAM-hungry processes | List of processes sorted by %MEM |
|
Check kernel OOM log | Details of processes killed by OOM killer |
|
Check system log OOM events | Timestamps and PIDs of killed processes |
|
Check kernel memory cache usage | Detailed slab allocator usage |
|
Monitor memory activity in real-time | High si/so columns = danger zone |
|
Detailed memory status | Low MemAvailable = action needed |
|
OOM kill event history | Increasing oom_kill counter = OOM events occurred |
Step 1: Check dmesg for OOM Kill Details
dmesg | grep -i oom
The output will provide more complete details about which process was killed, how much RAM was needed vs available, and the OOM score of each process.
2. Identify RAM-Hungry Processes
ps aux --sort=-%mem | head -20
This shows you which processes are consuming the most RAM. If any VPS has abnormally high RAM usage, that needs immediate attention.
3. Check for Memory Leaks
# Monitor for 5 minutes
vmstat 1 300 | tee /tmp/vmstat-monitor.txt
Watch the si (swap in) and so (swap out) columns. If they’re consistently high, there’s a serious memory problem.
Root Cause: Why Did RAM Run Out?
Based on the logs we analyzed, here are the most likely root causes:
| Possibility | Explanation | How to Verify |
|---|---|---|
| VPS RAM overcommit | Total RAM allocated to VPS instances exceeds host physical RAM | Compare total VPS RAM allocation vs host physical RAM |
| Memory leak in application | An application on one VPS is leaking memory (not releasing RAM it has used) | Monitor per-VPS RAM usage over 24 hours, look for steady increase |
| Burst RAM exhaustion | VPS with burst RAM enabled are consuming host RAM beyond normal allocation | Check which VPS instances are using high burst RAM |
| Netdata memory bloat | Netdata itself is consuming significant RAM for historical data caching | Check Netdata RAM usage: ps aux | grep netdata |
| High kernel slab cache | Kernel is using excessive RAM for inode cache, dentry cache, etc. | slabtop -s c |
Solutions & Prevention
1. Optimize Netdata Memory Usage
Netdata already has DBENGINE memory protection enabled, but we can be more aggressive:
# Edit Netdata configuration
cat /etc/netdata/netdata.conf | grep -A 10 "[db]"
Ensure these settings are present:
[db]
mode = dbengine
storage tier = 3
page cache size = 32M
dbengine disk space = 1G
dbengine multihost disk space = 2G
memory mode = dbengine
OOM score = 0
2. Set OOM Score Adjustment for Critical Processes
# Set Netdata OOM score to -500 (heavily protected)
echo -500 > /proc/$(pgrep netdata)/oom_score_adj
# Check current OOM score
cat /proc/$(pgrep netdata)/oom_score_adj
3. Monitor RAM Usage Proactively
Create a simple monitoring script:
#!/bin/bash
# Script: ram-monitor.sh
THRESHOLD=85
AVAILABLE=$(free -m | awk '/^Mem:/{print $7}')
TOTAL=$(free -m | awk '/^Mem:/{print $2}')
USAGE=$((100 - (AVAILABLE * 100 / TOTAL)))
if [ $USAGE -gt $THRESHOLD ]; then
echo "WARNING: RAM usage at ${USAGE}%" | mail -s "RAM Alert" admin@domain.com
logger -p warning "RAM usage critical: ${USAGE}% available: ${AVAILABLE}MB"
fi
Run this script via cron every 5 minutes:
*/5 * * * * /root/scripts/ram-monitor.sh
4. Cap RAM per VPS
Ensure total RAM allocation for all VPS instances doesn’t exceed 80% of host physical RAM. For example, if the host has 220GiB RAM, total VPS allocation should not exceed ~176GiB.
5. Identify & Handle Overcommitting VPS
# List all VPS and their RAM usage (Proxmox example)
qm list
# Detailed RAM usage per VM
for vm in $(qm list | awk 'NR>1{print $1}'); do
echo "VM $vm: $(qm status $vm 2>/dev/null)"
done
Pro Tips from Experience
Total RAM ร 0.8 รท number of VPS. Never overcommit โ leave 20% headroom for host OS, kernel, and Netdata./var/log/messages are just summaries. The full details are in dmesg. Always run dmesg | grep -i oom for comprehensive information.FAQ
Q: Will my VPS immediately go down if the host experiences an OOM kill?
A: Not immediately. In the logs above, what was killed were host-level Netdata processes, not VPS processes. But this is a warning sign โ if OOM events continue and worsen, your VPS could be the next victim.
Q: Why did some processes get signal 15 and others got signal 9?
A: Signal 15 (SIGTERM) is a polite termination request โ the OS asks the process to clean up first. Signal 9 (SIGKILL) is a forced kill, no mercy. Processes that get SIGKILL are usually ones that refused to stop after receiving SIGTERM, or processes deemed too resource-intensive.
Q: How do I prevent OOM kills on a hardware node?
A: Ensure total VPS RAM allocation doesn’t exceed 80% of host physical RAM. Monitor RAM usage proactively, set OOM score adjustments for critical processes, and identify overcommitting VPS instances early.
Q: Is Netdata causing the OOM?
A: It could be a contributing factor, but it’s usually not the root cause. The more common culprits are overcommitting VPS instances or applications with memory leaks. Netdata itself has OOM score 0 protection to minimize its risk of being killed โ ironically, it still got terminated in this case.
Q: Do I need to restart Netdata after an OOM kill?
A: Netdata typically restarts its plugins automatically. But if the Netdata daemon itself was killed, you’ll need to restart manually: systemctl restart netdata. Always investigate why it crashed completely before restarting.
Conclusion
OOM kill logs on a hardware node are not something you can ignore. Think of them as a check engine light on your car โ you might still be able to drive, but you need to get it checked before you’re stranded on the highway.
From the log analysis above, we can conclude that a hardware node with 220GiB of RAM is under significant memory pressure. Netdata plugins were terminated as a protective measure, and this situation needs immediate attention before the impact spreads to VPS instances hosted on it.
The first step you should take right now: run free -h and ps aux --sort=-%mem | head -20 on the hardware node to identify who’s consuming the most RAM. From there, you can determine the next course of action โ whether it’s migrating VPS instances, optimizing applications, or upgrading host RAM.
Don’t wait until your client messages you saying “my server is down.” Prevent it now, before it’s too late.
Need help analyzing hardware node logs or optimizing VPS resource allocation? Contact our NOC team for a free consultation.