Linux 内存调优的两个重要参数
今天在看这篇介绍 Linux 性能调优 的博客(Linux Performance: Almost Always Add Swap Space),其中涉及到如何调整内核内存的调整机制。主要的参数有
-
swappiness
: This control is used to define how aggressively the kernel will swap memory pages. Higher values will increase aggressiveness; lower values decrease the amount of swap. (default = 60, recommended values between 1 and 60) Remove your swap for 0 value, but it is usually not recommended in most cases. -
vfs_cache_pressure
: Controls the kernel’s tendency to reclaim the memory, which is used for caching of directory and inode objects. (default = 100, recommend value 50 to 200)