performance - Linux memory usage: Can we consider memory full when swap is unused? -
i checking available free memory after deploying our applications. using below command , finding free memory less 20%:
free | grep mem | awk '{print "free memory :"100*($4+$6+$7)/$2"%"}'
but when check top command, see swap memory not used @ all. above command doesn't include swap memory space. have several questions in mind
snapshot1:
top - 10:01:07 305 days, 11:23, 1 user, load average: 0.35, 0.22, 0.12 tasks: 244 total, 1 running, 242 sleeping, 0 stopped, 1 zombie cpu(s): 13.4%us, 14.5%sy, 0.0%ni, 69.3%id, 0.8%wa, 0.4%hi, 1.6%si, 0.0%st mem: 15952m total, 15817m used, 135m free, 531m buffers swap: 16378m total, 0m used, 16378m free, 2567m cached pid user pr ni virt res shr s %cpu %mem time+ command 19983 user1 20 0 3410m 2.9g 4420 s 23 18.9 56733:33 x1 28390 user2 20 0 621m 216m 1300 s 12 1.4 40201:39 p2 24781 user1 20 0 1393m 868m 1760 s 9 5.4 27795:12 p3 13936 user1 20 0 740m 432m 2692 s 6 2.7 15726:39 p4 30545 user1 20 0 391m 77m 2232 s 6 0.5 2805:05 p5 5696 user1 20 0 914m 680m 2180 s 4 4.3 2209:03 p6 28801 user2 20 0 282m 148m 1432 s 4 0.9 12408:20 p7 29559 user2 20 0 504m 357m 2028 s 3 2.2 9152:52 p8 29129 user2 20 0 245m 172m 2004 s 2 1.1 6935:50 p9 29130 user2 20 0 245m 172m 1996 s 2 1.1 6879:25 p9 29131 user2 20 0 245m 172m 1996 s 2 1.1 6913:15 p9 29135 user2 20 0 245m 172m 1996 s 2 1.1 6897:49 p9 29140 user2 20 0 245m 172m 1996 s 2 1.1 6886:52 p9
snapshot 2:
top - 10:06:18 312 days, 11:29, 1 user, load average: 0.26, 0.42, 0.31 tasks: 240 total, 1 running, 238 sleeping, 0 stopped, 1 zombie cpu(s): 13.1%us, 11.8%sy, 0.0%ni, 71.8%id, 1.7%wa, 0.5%hi, 1.1%si, 0.0%st mem: 15952m total, 15832m used, 119m free, 480m buffers swap: 16378m total, 0m used, 16378m free, 2622m cached pid user pr ni virt res shr s %cpu %mem time+ command 19983 user1 20 0 3410m 2.9g 5292 s 18 18.9 58711:30 x1 28390 user2 20 0 621m 216m 1300 s 12 1.4 41451:12 p2 24781 user1 20 0 1393m 868m 1760 s 8 5.4 28615:15 p3 13936 user1 20 0 740m 432m 2692 s 6 2.7 16247:35 p4 12453 user1 20 0 387m 74m 3056 s 5 0.5 178:45.72 p5 28801 user2 20 0 282m 148m 1448 s 4 0.9 12794:23 p6 13252 user1 20 0 850m 665m 2556 s 4 4.2 138:43.83 p7 29559 user2 20 0 504m 357m 1992 s 3 2.2 9450:05 p8 29154 user2 20 0 245m 172m 1972 s 3 1.1 7127:40 p9 29130 user2 20 0 245m 172m 1972 s 2 1.1 7104:03 p9 29140 user2 20 0 245m 172m 1972 s 2 1.1 7111:48 p9 29171 user2 20 0 244m 172m 1972 s 2 1.1 7137:48 p9 29129 user2 20 0 245m 172m 1980 s 2 1.1 7162:12 p9
am using correct method check available free space? (i need raise alarm when memory usage high)
2.from below 2 snapshots see free memory reduced "135m free" "119m free" (pls check mem: row of top command). see memory related processes (even other) not changed buffers , cache reduced. have read earlier these memory released os if enough memory not available processes. should worry change? there way clear this?
- my system has mem:15952m total, swap:16378m total total available space? system performance go down once swap memory starts being used?
pls guide me
example free memory output:
>free total used free shared buffers cached mem: 8183648 7148324 1035324 0 150568 2352956 -/+ buffers/cache: 4644800 3538848 swap: 17149376 24588 17124788
Comments
Post a Comment