日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux cache 内核参数,Linux内核中drop_caches参数

發布時間:2024/8/1 linux 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux cache 内核参数,Linux内核中drop_caches参数 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

該參數從 Kernels 2.6.16 開始引入,用于調整內核清理緩存的行為,該操作將回收緩存及清理可回收對象。一旦回收完成,該部分內存將變成 free 。

drop_caches 參數共有三個值:

1: 只清理 pagecache

2: 清理可回收對象(包括 dentries 和 inodes)

3: 同時清理 pagecache 和 可回收對象

此操作是非破壞性的操作,不會釋放任何的臟數據。如果需要增加被釋放的對象,需要先運行 sync 操作。

設置此參數可能導致系統性能下降,主要是由于他丟棄了一部分緩存對象,導致頻繁的與磁盤交互進行對象的重建,不建議在測試環境以外使用。

英文摘要:

drop_caches

Writing to this will cause the kernel to drop clean caches, as well as

reclaimable slab objects like dentries and inodes. Once dropped, their

memory becomes free.

To free pagecache:

echo 1 > /proc/sys/vm/drop_caches

To free reclaimable slab objects (includes dentries and inodes):

echo 2 > /proc/sys/vm/drop_caches

To free slab objects and pagecache:

echo 3 > /proc/sys/vm/drop_caches

This is a non-destructive operation and will not free any dirty objects.

To increase the number of objects freed by this operation, the user may run

`sync’ prior to writing to /proc/sys/vm/drop_caches. This will minimize the

number of dirty objects on the system and create more candidates to be

dropped.

This file is not a means to control the growth of the various kernel caches

(inodes, dentries, pagecache, etc…) These objects are automatically

reclaimed by the kernel when memory is needed elsewhere on the system.

Use of this file can cause performance problems. Since it discards cached

objects, it may cost a significant amount of I/O and CPU to recreate the

dropped objects, especially if they were under heavy use. Because of this,

use outside of a testing or debugging environment is not recommended.

You may see informational messages in your kernel log when this file is

used:

cat (1234): drop_caches: 3

These are informational only. They do not mean that anything is wrong

with your system. To disable them, echo 4 (bit 2) into drop_caches.

總結

以上是生活随笔為你收集整理的linux cache 内核参数,Linux内核中drop_caches参数的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。