Difference between revisions of "Swap"

100 bytes added ,  2 years ago
m
Improved readability
m (Corrected minor typos)
m (Improved readability)
Line 77: Line 77:


<translate><!--T:29--> The following script will:</translate>
<translate><!--T:29--> The following script will:</translate>
* <translate><!--T:30--> show whether zswap is active or not and if active, give zswap parameters if run with the {{$ic|sudo}} command</translate>
* <translate><!--T:30--> show whether zswap is active or not and if active, give zswap parameters if run with the {{ic|sudo}} command</translate>
* <translate><!--T:31--> display a list of all applications / services that take up swap and how much they take up in descending order</translate>
* <translate><!--T:31--> display a list of all applications / services that take up swap and how much they take up in descending order</translate>


Line 261: Line 261:


<!--T:72-->
<!--T:72-->
To enable zswap with systemd-swap, simply alter the instructions above and set Linux Kernel parameter {{ic|zswap_enabled=1}}</translate>
To enable zswap with systemd-swap, simply alter the instructions above and set Linux Kernel parameter zswap_enabled=1</translate>
<translate>
<translate>
=Tuning & Performance Considerations= <!--T:73-->
=Tuning & Performance Considerations= <!--T:73-->
Line 274: Line 274:
<translate><!--T:76--> {{ic|swappiness}} controls how likely a page is to be transferred to swap.  This value represents the percentage of the free memory before activating swap. The lower the value, the less swapping is used and the more memory pages are kept in physical memory where:</translate>
<translate><!--T:76--> {{ic|swappiness}} controls how likely a page is to be transferred to swap.  This value represents the percentage of the free memory before activating swap. The lower the value, the less swapping is used and the more memory pages are kept in physical memory where:</translate>
* <translate><!--T:77--> 0 disables swap</translate>
* <translate><!--T:77--> 0 disables swap</translate>
* <translate><!--T:78--> 60 is the default value which is ideal for a server running a lot of services</translate>
* <translate><!--T:78--> 60 is the default value which is ideal for a server that is memory-starved and running a lot of services</translate>
* <translate><!--T:79--> 100 is very aggressive swapping.</translate>
* <translate><!--T:79--> 100 is very aggressive swapping.</translate>


<translate><!--T:80--> For ''most'' computers the recommended value is 10: Theoretically, this means to only start swapping when RAM usage reaches around 90 percent.</translate>
<translate><!--T:80--> For ''most'' desktop computers the recommended value is 10: Theoretically, this means to only start swapping when RAM usage reaches around 90 percent.</translate>


<translate><!--T:81--> {{ic|vfs_cache_pressure}} is a percentage value that controls the tendency of the kernel to ''reclaim'' the memory which is used for caching of directory and inode objects.  The default value is 100.</translate>  <translate><!--T:82--> Increasing this value will increase the rate in which these objects are removed from the RAM cache.  Decreasing it will allow these objects to be cached in memory longer, consuming additional RAM over time.</translate>  <translate><!--T:83--> Depending on your specific workload, increasing or decreasing this value too far can have significant negative impacts on system performance.</translate>  <translate><!--T:84--> Experimentation is needed to find the appropriate balance and the default value is reasonable.  In general, it is more common to optimize swappiness before experimenting with vfs_cache_pressure.</translate>
<translate><!--T:81--> {{ic|vfs_cache_pressure}} used to be a percentage value that controls the tendency of the kernel to ''reclaim'' the memory which is used for caching of directory and inode objects with a default value of 100 on Kernels <5.4. On Kernels >=5.4 can be increased beyond 100.</translate>  <translate><!--T:82--> Increasing this value will increase the rate in which these objects are removed from the RAM cache.  Decreasing it will allow these objects to be cached in memory longer, consuming additional RAM over time.</translate>  <translate><!--T:83--> Depending on your specific workload, increasing or decreasing this value too far can have significant negative impacts on system performance.</translate>  <translate><!--T:84--> Experimentation is needed to find the appropriate balance and the default value is reasonable.  In general, it is more common to optimize swappiness before experimenting with vfs_cache_pressure.</translate>


<translate><!--T:85--> To set these values you can use the command {{ic|sysctl}}.  For example, to set the swappiness value to 10 you could use:</translate>
<translate><!--T:85--> To set these values you can use the command {{ic|sysctl}}.  For example, to set the swappiness value to 10 you could use:</translate>
Moderators, translator
286

edits