Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


reduce_swappiness

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
reduce_swappiness [2014/05/22 08:14] adminreduce_swappiness [2014/05/22 09:18] admin
Line 2: Line 2:
 If you have enough RAM, then you can reduce swappiness and thus avoid writes to swap. If you have enough RAM, then you can reduce swappiness and thus avoid writes to swap.
  
-  * Check current setting: <code>cat /proc/sys/vm/swappiness</code>+  * Check current setting: <code>cat /proc/sys/vm/swappiness 
 +cat /proc/sys/vm/vfs_cache_pressure</code>
   * Change setting, edit **/etc/sysctl.d/swappiness.conf**. <code>mkdir -p /etc/sysctl.d   * Change setting, edit **/etc/sysctl.d/swappiness.conf**. <code>mkdir -p /etc/sysctl.d
- +vi /etc/sysctl.d/swappiness.conf</code><code>vm.swappiness=1 
-vi /etc/sysctl.d/swappiness.conf +vm.vfs_cache_pressure=50</code>
-  vm.swappiness=1 +
-  vm.vfs_cache_pressure=50</code>+
   * Then activate the change. <code>sysctl -p /etc/sysctl.d/swappiness.conf</code>   * Then activate the change. <code>sysctl -p /etc/sysctl.d/swappiness.conf</code>
  
reduce_swappiness.txt · Last modified: 2021/10/09 15:14 by 127.0.0.1