我要评分
获取效率
正确性
完整性
易理解

Modifying Cache Parameters

Purpose

Modify some cache parameter settings at the operating system layer to improve server performance.

Procedure

Modify the parameters based on the following table.

Table 1 Cache parameters

Linux Parameter

Description

Procedure or Command

swappiness

Policy of using the swap partition and memory. A larger value indicates more active use of the swap partition, and a smaller value indicates more active use of the memory.

  1. Open the file.
    vim /etc/sysctl.conf
  2. Press i to enter the insert mode and add vm.swappiness = 1 to the end of the file.
  3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Make the modification take effect.
    sysctl -p

dirty_ratio

Percentage of dirty data allowed in the memory

echo 5 > /proc/sys/vm/dirty_ratio