使用Linux的sar 命令来计算Linux的内存剩余
2015-10-04 10:42
387 查看
使用Linux的sar 命令来计算Linux的内存剩余
参考自:
How to Calculate Memory Usage on Linux (文档 ID 1630754.1)
我们再来看free -m的输出:
可以看到:sar -r 1 10 计算出来的剩余内存食欲 free -m计算出来的剩余内存是基本一致的。
参考自:
How to Calculate Memory Usage on Linux (文档 ID 1630754.1)
[root@rhel63single ~]# sar -r 1 10 Linux 2.6.32-279.el6.x86_64 (rhel63single) 09/29/2015 _x86_64_ (4 CPU) 07:32:44 AM kbmemfree kbmemused %memused kbbuffers kbcached kbcommit %commit 07:32:45 AM 1137164 925132 44.86 175292 340292 4002408 96.22 07:32:46 AM 1137048 925248 44.86 175292 340304 4004460 96.27 07:32:47 AM 1136924 925372 44.87 175292 340304 4006512 96.32 07:32:48 AM 1136924 925372 44.87 175292 340304 4008564 96.37 07:32:49 AM 1136916 925380 44.87 175292 340304 4010616 96.42 07:32:50 AM 1136800 925496 44.88 175292 340312 4012668 96.47 07:32:51 AM 1136792 925504 44.88 175292 340304 4014720 96.52 07:32:52 AM 1136784 925512 44.88 175292 340316 4016772 96.57 07:32:53 AM 1136660 925636 44.88 175292 340316 4018832 96.62 07:32:54 AM 1136652 925644 44.88 175292 340324 4020880 96.67 Average: 1136866 925430 44.87 175292 340308 4011643 96.45 此处值 此处值 此处值
[root@rhel63single ~]# uname -r 2.6.32-279.el6.x86_64 [root@rhel63single ~]# uname -a Linux rhel63single 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
计算公式为: 剩余内存=(1136866+175292+340308)/1024=1613.736328 MB
我们再来看free -m的输出:
[root@rhel63single ~]# free -m total used free shared buffers cached Mem: 2013 902 1110 0 171 332 -/+ buffers/cache: 399 1614 --->此处值。 Swap: 2047 0 2047
可以看到:sar -r 1 10 计算出来的剩余内存食欲 free -m计算出来的剩余内存是基本一致的。
相关文章推荐
- Linux运维常用命令
- linux 正则表达式 sed
- linux常用命令
- linux 关于.a
- 在 CentOS 7 中安装并使用自动化工具 Ansible
- Linux写时拷贝技术(copy-on-write)
- 基于AM335x的U-Boot/SPL 的CCS 调试
- 【Linux高频命令专题(9)】ls
- 【Linux高频命令专题(8)】五大查询命令
- CentOS 6.7下PXE+Kickstart无人值守安装操作系统
- Linux系统结构 详解
- 查看linux版本
- linux下启动和关闭网卡命令
- linux下改变文件/文件夹所属用户或群组
- centos:only for i686
- CentOS Linux解决Device eth0 does not seem to be present
- 64位的linux装的hadoop是32位的,需要手工编译
- 1.3、centos配置静态ip(ok)
- 1.1.1、 linux防火墙
- linux的简单使用和软件安装