空き容量 -m メモリ使用量の理解

空き容量 -m メモリ使用量の理解

わかりません。これを示すときfree -m

             total       used       free     shared    buffers     cached
Mem:         15334      14025       1308          0        258      10918
-/+ buffers/cache:       2848      12485
Swap:          953          0        953

これは、行1に1.4GBの空き容量があることを意味しますか、それとも行2に12GBの空き容量があるという意味ですか?

Linux + Nginx + php-fpm + Mysql + Memcachedがあります。

編集する:

1.3GBが未使用の空きメモリであることを知っていますが、バッファ使用量を削除すると、実際にvpsに12GBの空きメモリがあります。これは、私のvpsに必要なものより16GBが多く、12GBを使用できるため、大きなコンピュータに無駄になっているという意味ですか?それとも1行目を見ると、バッファが多くのメモリを使用していると仮定していますか?これはバッファの使用がより速い応答を意味するので、私のコンピュータがまだ多くのメモリの利点を享受していることを意味しますか?

答え1

最初の行は、データキャッシュまたはI / Oバッファリングに使用されるメモリ部分を考慮(追加)したメモリcache使用量を示しています。buffers

一方、2番目の行はとを考慮(控除)しなかったcacheメモリ使用量を示しますbuffers

これで、新しいプロセスに最初の行に表示されているよりも多くのメモリが必要かどうか疑問に思います。つまり、最新のプロセスのためのスペースを確保するために、cache/buffersこのキャッシュから最も古いデータが消去されることを考慮してください。cacheしたがって、キャッシュ/バッファリングが占める膨大なスペースを心配する必要はありません。

編集者に返信:

キャッシュが多いほど応答速度が速くなります。だから、それがあなたを完全に迷惑にしない限り、あなたはそれをかなりうまくいきます。

答え2

マンページを無料で確認することをお勧めします(下記の抜粋を参照)。

# man free

NAME
       free - Display amount of free and used memory in the system

SYNOPSIS
       free [options]

DESCRIPTION
       free displays the total amount of free and used physical and swap memory in the system, as well as the buffers and caches used by the kernel. The information is gath‐
       ered by parsing /proc/meminfo. The displayed columns are:

       total  Total installed memory (MemTotal and SwapTotal in /proc/meminfo)

       used   Used memory (calculated as total - free)

       free   Unused memory (MemFree and SwapFree in /proc/meminfo)

       shared Memory used (mostly) by tmpfs (Shmem in /proc/meminfo, available on kernels 2.6.32, displayed as zero if not available)

       buffers
              Memory used by kernel buffers (Buffers in /proc/meminfo)

       cached Memory used by the page cache  (calculated as Cached - Shmem in /proc/meminfo - the Cached value is actually the sum of page cache and tmpfs memory)

関連情報