Why use swap when there is more than enough RAM.
Swappiness is a property of the Linux kernel that changes the balance between swapping out runtime memory, as opposed to dropping pages from the system page cache. Swappiness can be set to values between 0 and 100 inclusive. A low value means the kernel will try to avoid swapping as much as possible where a higher value instead will make the kernel aggressively try to use swap space. The default value is 60, and for most desktop systems, setting it to 100 may affect the overall performance, whereas setting it lower (even 0) may improve interactivity (by decreasing response latency.)
In short:
| Value | Strategy |
|---|---|
vm.swappiness = 0 |
The kernel will swap only to avoid an out of memory condition. |
vm.swappiness = 60 |
The default value. |
vm.swappiness = 100 |
The kernel will swap aggressively which may affect over all performance. |
To temporarily set the swappiness in Linux, write the desired value (e.g. 10) to /proc/sys/vm/swappiness using the following command, running as root user:
# Set the swappiness value as root
echo 10 > /proc/sys/vm/swappiness
# Alternatively, run this as a non-root user
sudo sysctl -w vm.swappiness=10
# Verify the change
cat /proc/sys/vm/swappiness
10
Permanent changes are made in /etc/sysctl.conf via the following configuration line (inserted if not present previously):
vm.swappiness = 10
释放swap
Why use swap when there is more than enough RAM.的更多相关文章
- How To Add Swap on Ubuntu 14.04
https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04 How To Add Swap on ...
- Ubuntu swap
问:我是一个Ubuntu 14.04 LTS版本的新手.我需要一块额外的swap文件来提高我Ubuntu服务器的性能.我怎样才能通过SSH连接用相关命令为我的Ubuntu 14.04 LTS 增加一块 ...
- How To Add Swap Space on Ubuntu 16.04
Introduction One of the easiest way of increasing the responsiveness of your server and guarding aga ...
- Linux swap分区操作
swap交换分区是系统RAM的补充,swap 分区支持虚拟内存.当没有足够的 RAM 保存系统处理的数据时,会将数据写入 swap 分区,当系统缺乏 swap 空间时,内核会因 RAM 内存耗尽而终止 ...
- Linux监控工具介绍系列——vmstat
说来惭愧,玩Linux这么久了,居然没有玩转vmstat这个命令,对很多指标的具体意义都有点模糊不清,花了点时间好好学习.整理一下这个命令的相关资料.因为这个命令确实比较重要,而且频繁用到. 命令 ...
- Linux监控工具介绍系列——free
在Linux系统中,我们查看.监控系统内存使用情况,一般最常用的命令就是free.free命令其实非常简单,参数也非常简单,但是里面很多知识点未必你都掌握了.下面总结一下我所了解的free命令.如有不 ...
- Linux 下 Oracle 内核参数优化
数据库的性能优化涉及到整个数据库运行环境的方方面面,诸如操作系统,Oracle自身,存储,网络等等几个大块.而操作系统则是Oracle稳定运行与最大化性能的基石.本文主要描述基于Linux系统下 Or ...
- windows平台下redis安装及配置文件介绍
1.redis介绍 redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zset(s ...
- PostgreSQL Hardware Performance Tuning
Bruce Momjian POSTGRESQL is an object-relational database developed on the Internet by a group of de ...
随机推荐
- print函数用法总结
输出print函数总结: 1,字符串和数字类型 2,变量(数值,布尔,列表,字典) 3,格式化输出 格式化输出总结: (1)%:标记转换说明符的开始 (2)转换标志: - 表示左对齐:+ 表示在转换值 ...
- 最近跟进一个CS项目,用到c#基础知识,准备开个分类记录一下
C#在txt类文件中追加内容 string path = "test.txt";FileStream mystream = new FileStream(path, FileMod ...
- linux IPC简单学习
Posix和system v区别 所谓的IPC(进程间通信)指的是消息队列,共享内存,信号量3种机制合并起来,当然,这是个狭义的概念,只包含这三种.IPC又可以分为system v进程间通信和posi ...
- Device doesn't support wireless sync. AMDeviceStartService
Flutter1.9.1+hotfix2 Dart2.5 在iOS13真机上启动不了 错误信息 Device doesn't support wireless sync. AMDeviceStartS ...
- lucene初探
http://www.cnblogs.com/xing901022/p/3933675.html
- kali 系统膨胀后如何处理
1.一般使用的kali 安装都是将系统文件全部放在一个总分区中,应用程序会产生临时文件,另外在安装软件的时候会出现 系统框架的不同,但是kali并不会检测该问题,直接当依赖的框架下载,可以是使用命令 ...
- Windows——Thinkpad 开机显示pwmtr64v.dll找不到指定的模块
解决方法:进入设备管理器,展开系统设备分页,找到Lenovo Power Manager ,右键,更新驱动程序,浏览计算机上的驱动程序, 让我从计算机上的可用驱动程序列表中选取,选择Lenovo Po ...
- ubuntu---记录.动态库默认路径的踩坑
发现这个问题,还是经过一个报错问题卡了好多天,然后请求好多人的支援,最后个人的疑问:为什么明明指明了路径,生成 .SO 没有问题,在调用.SO 就有问题,报错各种找不到函数或者未定义,然后把缺的 *. ...
- mysql查询某一列的数据最大字节
语法:select 列名, length(列名) from 表名where length(列名) = ( select max(length(列名)) from 表名); 实例:select proj ...
- k8s的Pod状态和生命周期管理
Pod状态和生命周期管理 一.什么是Pod? 二.Pod中如何管理多个容器? 三.使用Pod 四.Pod的持久性和终止 五.Pause容器 六.init容器 七.Pod的生命周期 (1)Pod p ...