The swpd field indicates how much swap space has been used; this value increases when the systems physical memory is full and the Linux kernel starts to use the swap partition/file. When the systems physical memory and swap space has been exhausted
from our RHEL 7.2 machine we can see the following
vmstat 1 20
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
3 0 1029076 6695152 4 49021608 1 1 520 32 2 2 9 1 90 0 0
2 0 1029076 6694024 4 49022924 0 0 19612 0 5761 4269 7 1 91 0 0
8 0 1029076 6665220 4 49021688 0 0 14812 707 22450 26191 13 3 84 0 0
2 0 1029076 6656396 4 49021704 0 0 15748 0 17994 21252 9 2 88 0 0
2 0 1029088 6649536 4 49022448 0 12 33972 12 13426 14773 8 2 90 1 0
2 0 1029088 6687988 4 49022604 0 0 31212 0 6085 4391 7 2 91 0 0
2 0 1029088 6688688 4 49022340 0 0 27040 9 7001 8469 4 1 95 1 0
3 0 1029092 6689572 4 49022820 0 4 12136 28 3390 2773 4 0 96 0 0
1 0 1029092 6689856 4 49022224 0 0 13776 0 3460 2841 4 0 96 0 0
1 0 1029092 6690356 4 49021820 0 0 18444 0 3445 2819 4 0 96 0 0
1 0 1029092 6689864 4 49021520 0 0 18768 0 3743 3005 4 0 96 0 0
1 0 1029092 6693856 4 49021452 0 0 17544 0 3406 2732 4 0 96 0 0
1 0 1029092 6694048 4 49021208 0 0 24244 292 4654 4816 4 1 95 0 0
1 0 1029092 6695096 4 49021312 0 0 15572 0 3431 2835 4 0 96 0 0
2 0 1029092 6694536 4 49022072 0 0 17476 0 5065 4033 7 1 91 0 0
2 1 1029092 6685364 4 49022140 0 0 28112 9 24914 30798 10 3 86 1 0
1 0 1029092 6684160 4 49021280 0 0 10356 104 14245 16378 5 2 93 0 0
1 0 1029092 6671432 4 49022212 0 0 12816 20 11465 13620 5 1 94 0 0
1 0 1029092 6707700 4 49022364 0 0 19840 0 4113 3603 4 0 95 0 0
2 0 1029092 6706948 4 49022364 0 0 18128 0 3324 2833 4 0 96 0 0
dose high values of swpd indicate on problem?
free -g
total used free shared buff/cache available
Mem: 122 69 6 8 46 43
Swap: 15 0 14
vmstat 1 20
128195440 K total memory
72465912 K used memory
77700088 K active memory
36918416 K inactive memory
6707164 K free memory
4 K buffer memory
49022360 K swap cache
16351228 K total swap
1029076 K used swap
15322152 K free swap
137196351 non-nice user cpu ticks
778 nice user cpu ticks
21836716 system cpu ticks
1437416566 idle cpu ticks
7095049 IO-wait cpu ticks
0 IRQ cpu ticks
1280657 softirq cpu ticks
0 stolen cpu ticks
8346063429 pages paged in
515040249 pages paged out
3267044 pages swapped in
5005632 pages swapped out
4242627451 interrupts
1713287115 CPU context switches
1705353038 boot time
31037695 forks
sar -B 2 5
03:37:14 PM pgpgin/s pgpgout/s fault/s majflt/s pgfree/s pgscank/s pgscand/s pgsteal/s %vmeff
03:37:16 PM 0.00 6.00 133.50 0.00 93.00 0.00 0.00 0.00 0.00
03:37:18 PM 0.00 0.00 34.50 0.00 91.50 0.00 0.00 0.00 0.00
03:37:20 PM 0.00 4.50 50683.50 0.00 19022.00 0.00 0.00 0.00 0.00
03:37:22 PM 60.00 2.00 11028.50 0.00 10382.00 0.00 0.00 0.00 0.00
03:37:24 PM 0.00 0.00 805.00 0.00 1205.50 0.00 0.00 0.00 0.00
Average: 12.00 2.50 12537.00 0.00 6158.80 0.00 0.00 0.00 0.00
sar -d
03:34:42 PM DEV tps rd_sec/s wr_sec/s avgrq-sz avgqu-sz await svctm %util
03:34:52 PM sda 448.60 20769.60 66.30 46.45 0.60 1.35 0.15 6.73
You have 1 GB of 15 GB of swap space used on a machine with a total of 122 GB RAM. Does this value indicate a problem? No.
As long as you have zero or minimal swap in/out (si/so columns) then the larger the used swap the more real RAM is available to the applications or caching and the better the performance.