Site Tools


start: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
start:swappiness [2023/03/09 13:43] peterstart:swappiness [2023/09/13 18:38] (current) peter
Line 1: Line 1:
 +DATE CHECKED THIS PAGE WAS VALID: 13/09/2023 
 +
 The default swappiness of Linux in general is 60 which works very well. 100 means it moves things out of RAM into swap as soon as possible and 0 means try avoid using swap. The default swappiness of Linux in general is 60 which works very well. 100 means it moves things out of RAM into swap as soon as possible and 0 means try avoid using swap.
  
Line 32: Line 34:
 Typical (sane) values would be between 50-150. Typical (sane) values would be between 50-150.
 If you have a raspberry pi with 1GB RAM, it may be beneficial to use a swapiness value higher than 100 eg: 101. Using 101 will mean it will prefer to move items into swap when possible. A value of 100 treats swap and RAM as identical priority and will be randomly given to one or the other. Reason on a pi you might want to push items into ram slightly more is that there is little memory and in addition if you configure zramswap this will free up real RAM and prevent the OOM killer running under heavy RAM workloads. If you have a raspberry pi with 1GB RAM, it may be beneficial to use a swapiness value higher than 100 eg: 101. Using 101 will mean it will prefer to move items into swap when possible. A value of 100 treats swap and RAM as identical priority and will be randomly given to one or the other. Reason on a pi you might want to push items into ram slightly more is that there is little memory and in addition if you configure zramswap this will free up real RAM and prevent the OOM killer running under heavy RAM workloads.
-Normal systems would use a value less than 100 as RAM is always faster than any type of SWAP (so no need to prioritize it). Unless the OOM killer is a problem, and you cannot add RAM to the system, no value over 99 should be considered. +Normal systems would use a value less than 100 as RAM is always faster than any type of SWAP (so no need to prioritize it). Unless the OOM killer is a problem, and you cannot add RAM to the system, no value over 99 should be considered. Even then I dont see much benefit to setting values other than 60-70 and leaving it at that, and setting outside that range means YOU did extensive testing over many days.
start/swappiness.1678369387.txt.gz · Last modified: 2023/03/09 13:43 by peter