问题原文
原帖链接 · geschema · CC BY-SA 4.0
This is what the free command reports on a server that is running a Spring Boot application behind an Nginx reverse proxy:
$ free -h
total used free shared buff/cache available
Mem: 1.9Gi 893Mi 164Mi 29Mi 919Mi 883Mi
Swap: 511Mi 481Mi 30Mi
How should I interpret the high swap usage? Is that a sign that I should upgrade the server to a higher memory capacity (e.g. 4 GiB)?
Output of vmstat
$ vmstat 1 5
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 493428 150620 95476 879668 0 1 8 28 1 0 3 1 95 0 1
0 0 493428 150620 95476 879708 0 0 0 4 970 1891 4 1 95 0 0
1 0 493428 150620 95476 879712 0 0 0 0 851 1708 6 6 86 0 3
2 0 493428 150620 95476 879712 0 0 0 0 704 1398 4 5 91 0 0
1 0 493428 150620 95476 879712 0 0 0 16 583 1206 3 3 94 0 0
已采纳解答
原帖链接 · Romeo Ninov · CC BY-SA 4.0
As you can see from vmstat output you do not have si or so activities, even the average (first line) is negligible. Try to play with swappiness but if you do not see serious performance degradation you do not need to change anything.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
