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