<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[AdminsForum - Performance and optimization]]></title>
		<link>https://adminsforum.com/</link>
		<description><![CDATA[AdminsForum - https://adminsforum.com]]></description>
		<pubDate>Thu, 15 Oct 2026 04:28:39 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[High Linux Memory Usage: Cache, Swap and OOM Troubleshooting]]></title>
			<link>https://adminsforum.com/Thread-guide-high-linux-memory-usage-cache-swap-and-oom-troubleshooting</link>
			<pubDate>Thu, 08 Oct 2026 03:11:59 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://adminsforum.com/member.php?action=profile&uid=2">DEV</a>]]></dc:creator>
			<guid isPermaLink="false">https://adminsforum.com/Thread-guide-high-linux-memory-usage-cache-swap-and-oom-troubleshooting</guid>
			<description><![CDATA[<span style="font-weight: bold;" class="mycode_b">Low “free” memory is not enough to diagnose a Linux memory problem. Look for available memory, sustained swapping, pressure and evidence of a killed process before changing limits.</span><br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">1. Capture the symptom and baseline</span></span><br />
Note whether the site is slow, an application exited or the whole VPS becomes unresponsive. On a systemd Linux server:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>free -h
uptime
vmstat 1 5
ps -eo pid,user,comm,rss --sort=-rss | head -n 15
sudo journalctl -k --since "1 hour ago" --no-pager</code></div></div>The first vmstat report reflects averages since boot; compare the later samples. RSS is in KiB in this ps format and shared memory can be counted across processes, so summing RSS is only a rough estimate. Avoid posting full process arguments, which can contain credentials.<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">2. Distinguish useful cache from pressure</span></span><br />
Linux uses otherwise idle memory for filesystem cache. The available estimate is more useful than free alone. Swap in use may remain after an earlier spike; sustained swap-in/out with latency is more concerning. Check the workload over time, including backups, imports and scheduled jobs.<br />
<br />
Do not routinely drop kernel caches to make a dashboard greener. It can increase disk reads and hide the real workload. Compare symptoms with memory pressure, process growth and application logs instead.<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">3. Investigate OOM and container limits</span></span><br />
Kernel logs may identify an out-of-memory kill and the selected process. A container or systemd cgroup can reach its own limit even when the host has spare memory. Inspect the relevant service/container memory limit and restart history. systemd-oomd can also terminate workloads based on pressure; inspect its journal when present.<br />
<br />
A database, PHP pool and background workers share the same VPS. Raising every concurrency setting at once can exhaust it. Find the time-correlated change: plugin deployment, traffic surge, import, larger database cache or leak.<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">4. Choose a measured correction</span></span><br />
Reduce excessive workers, bound caches, stagger heavy jobs or optimize the expensive request. If memory grows steadily under a repeatable workload, investigate a leak before using scheduled restarts as a permanent solution. Leave headroom for updates, backups and spikes.<br />
<br />
Swap can provide a safety cushion on supported filesystems, but disk-backed memory is slower and does not create more physical RAM. Confirm provider/filesystem support and existing swap/zram before adding another mechanism. Never run swapoff on a pressured production system without enough RAM to hold the swapped pages.<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">5. Test and monitor</span></span><br />
Change one setting during a maintenance window, preserve the previous configuration and compare response time, errors, available memory and swapping under similar load. Observe long enough to catch recurring jobs. An absence of OOM messages alone does not prove performance is healthy.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Useful report:</span> OS, RAM plan, container limits, affected service, baseline samples and sanitized OOM lines. Do not publish environment dumps or process command lines containing secrets.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">References:</span> Your installed man free, man vmstat and systemd resource-control documentation; <a href="https://www.php.net/manual/en/install.fpm.configuration.php" target="_blank" rel="noopener" class="mycode_url">PHP-FPM pool configuration</a> for PHP workloads.]]></description>
			<content:encoded><![CDATA[<span style="font-weight: bold;" class="mycode_b">Low “free” memory is not enough to diagnose a Linux memory problem. Look for available memory, sustained swapping, pressure and evidence of a killed process before changing limits.</span><br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">1. Capture the symptom and baseline</span></span><br />
Note whether the site is slow, an application exited or the whole VPS becomes unresponsive. On a systemd Linux server:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>free -h
uptime
vmstat 1 5
ps -eo pid,user,comm,rss --sort=-rss | head -n 15
sudo journalctl -k --since "1 hour ago" --no-pager</code></div></div>The first vmstat report reflects averages since boot; compare the later samples. RSS is in KiB in this ps format and shared memory can be counted across processes, so summing RSS is only a rough estimate. Avoid posting full process arguments, which can contain credentials.<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">2. Distinguish useful cache from pressure</span></span><br />
Linux uses otherwise idle memory for filesystem cache. The available estimate is more useful than free alone. Swap in use may remain after an earlier spike; sustained swap-in/out with latency is more concerning. Check the workload over time, including backups, imports and scheduled jobs.<br />
<br />
Do not routinely drop kernel caches to make a dashboard greener. It can increase disk reads and hide the real workload. Compare symptoms with memory pressure, process growth and application logs instead.<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">3. Investigate OOM and container limits</span></span><br />
Kernel logs may identify an out-of-memory kill and the selected process. A container or systemd cgroup can reach its own limit even when the host has spare memory. Inspect the relevant service/container memory limit and restart history. systemd-oomd can also terminate workloads based on pressure; inspect its journal when present.<br />
<br />
A database, PHP pool and background workers share the same VPS. Raising every concurrency setting at once can exhaust it. Find the time-correlated change: plugin deployment, traffic surge, import, larger database cache or leak.<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">4. Choose a measured correction</span></span><br />
Reduce excessive workers, bound caches, stagger heavy jobs or optimize the expensive request. If memory grows steadily under a repeatable workload, investigate a leak before using scheduled restarts as a permanent solution. Leave headroom for updates, backups and spikes.<br />
<br />
Swap can provide a safety cushion on supported filesystems, but disk-backed memory is slower and does not create more physical RAM. Confirm provider/filesystem support and existing swap/zram before adding another mechanism. Never run swapoff on a pressured production system without enough RAM to hold the swapped pages.<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">5. Test and monitor</span></span><br />
Change one setting during a maintenance window, preserve the previous configuration and compare response time, errors, available memory and swapping under similar load. Observe long enough to catch recurring jobs. An absence of OOM messages alone does not prove performance is healthy.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Useful report:</span> OS, RAM plan, container limits, affected service, baseline samples and sanitized OOM lines. Do not publish environment dumps or process command lines containing secrets.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">References:</span> Your installed man free, man vmstat and systemd resource-control documentation; <a href="https://www.php.net/manual/en/install.fpm.configuration.php" target="_blank" rel="noopener" class="mycode_url">PHP-FPM pool configuration</a> for PHP workloads.]]></content:encoded>
		</item>
	</channel>
</rss>