linux – 交换大量的ram可用

我有一个旧的,遗留的服务器与swap的奇怪问题.

> Linux版本:Red Hat Enterprise Linux Server 5.6版(Tikanga)
>内核版本:2.6.18-238.el5
>服务器是虚拟的.
>服务器有2个虚拟套接字.

我知道交换分区很小,要添加交换文件,但是,重启后几个小时,情况是这样的:

free -m
             total       used       free     shared    buffers     cached
Mem:         15922      15806        116          0        313      13345
-/+ buffers/cache:       2147      13775
Swap:         2047       2042          4

已安装Oracle数据库,但几乎未使用.我想了解为什么内存分配会这样.我的意思是13345缓存,意味着免费.为何填补掉期?

以前的sysadmin配置swappiness为:3.
未配置大页面.

我看到一些类似的帖子,但没有解决方案可以理解.答案在这里linux redhat 5.4 – swap while memory is still available谈论numa,所以我挖了一点(我是dba,而不是系统管理员,如果我错过了什么就很抱歉).

grep NUMA=y /boot/config-`uname -r`
CONfig_NUMA=y
CONfig_K8_NUMA=y
CONfig_X86_64_ACPI_NUMA=y
CONfig_ACPI_NUMA=y

dmesg | grep -i numa
NUMA: Using 63 for the hash shift.

所以,问题是:我怎么能理解为什么这台机器交换?

更新
使用:vmstat 2

procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 4  0 2090852 122224 324056 13679328  320    0   498  1898 1088 3555 32 10 56  2  0
 1  0 2090724 139740 324068 13680984   64    0    76   932 1028 3534  7  2 90  2  0
 0  0 2090724 132416 324068 13681436    0    0    16   240 1016 3401  3  1 96  1  0
 4  0 2090660 116916 324084 13683404    0    0    72  1396 1070 3617 11  9 80  1  0
 0  0 2090420 126544 324084 13687008  128    0   188  1872 1068 3436 35  8 56  2  0

更新3

ipcs -ma

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x61a4d538 5210113    oracle    660        4096       0
0xba8cafdc 5242883    oracle    660        4096       0
0x16621634 5308420    oracle    660        4096       0
0xc15f3dac 5373957    oracle    660        4096       0

------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0x24690d60 98304      oracle    660        125
0x24690d61 131073     oracle    660        125
0x24690d62 163842     oracle    660        125
0x24690d63 196611     oracle    660        125
0x24690d64 229380     oracle    660        125
0x24690d65 262149     oracle    660        125
0x24690d66 294918     oracle    660        125
0x24690d67 327687     oracle    660        125
0x24690d68 360456     oracle    660        125
0x6285541c 491529     oracle    660        125
0x6285541d 524298     oracle    660        125
0x6285541e 557067     oracle    660        125
0x6285541f 589836     oracle    660        125
0x62855420 622605     oracle    660        125
0x62855421 655374     oracle    660        125
0x62855422 688143     oracle    660        125
0x62855423 720912     oracle    660        125
0x62855424 753681     oracle    660        125
0xaee7ccbc 884754     oracle    660        125
0xaee7ccbd 917523     oracle    660        125
0xaee7ccbe 950292     oracle    660        125
0xaee7ccbf 983061     oracle    660        125
0xaee7ccc0 1015830    oracle    660        125
0xaee7ccc1 1048599    oracle    660        125
0xaee7ccc2 1081368    oracle    660        125
0xaee7ccc3 1114137    oracle    660        125
0xaee7ccc4 1146906    oracle    660        125
0xfb4a455c 1277979    oracle    660        125
0xfb4a455d 1310748    oracle    660        125
0xfb4a455e 1343517    oracle    660        125
0xfb4a455f 1376286    oracle    660        125
0xfb4a4560 1409055    oracle    660        125
0xfb4a4561 1441824    oracle    660        125
0xfb4a4562 1474593    oracle    660        125
0xfb4a4563 1507362    oracle    660        125
0xfb4a4564 1540131    oracle    660        125

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages

解决方法

如果你没有经历大量的活动分页(在vmstat中是si / so),那么就没什么好担心的了.内核选择将一些未被主动使用的程序代码交换掉,以便它可以将更多的DB文件保存在RAM中(缓存在免费中).

这是我发现的关于交换的优秀技巧,如何使用它并不总是坏的. https://chrisdown.name/2018/01/02/in-defence-of-swap.html

相关文章

Linux中的ARP防火墙主要用于防御ARP欺骗攻击,其效果取决于多...
insmod和modprobe加-f参数导致Invalid module format错误 这...
将ArchLinux安装到U盘 几个月前入门Arch的时候上网搜了不少安...
1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...