1、Linux的负载信息
文件:cat /proc/loadavg
2、Linux的内存信息
文件: cat /proc/meminfo
常用的内存负载信息:
cat /proc/meminfo | grep -E "^MemTotal:|^MemFree:|^Buffers:|^Cached:|^SwapCached:"
======== 文件说明
5.2.16. /proc/loadavg
This file provides a look at the load average in regard to both the CPU and IO over time, as well as additional data used by
uptime
and other commands. A sample /proc/loadavg
file looks similar to the following:0.20 0.18 0.12 1/80 11206
The first three columns measure CPU and IO utilization of the last one, five, and 10 minute periods. The fourth column shows the number of currently running processes and the total number of processes. The last column displays the last process ID used.
===
5.2.19. /proc/meminfo
This is one of the more commonly used files in the
/proc/
directory, as it reports a large amount of valuable information about the systems RAM usage.The following sample
/proc/meminfo
virtual file is from a system with 256 MB of RAM and 512 MB of swap space:MemTotal: 255908 kB MemFree: 69936 kB Buffers: 15812 kB Cached: 115124 kB SwapCached: 0 kB Active: 92700 kB Inactive: 63792 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 255908 kB LowFree: 69936 kB SwapTotal: 524280 kB SwapFree: 524280 kB Dirty: 4 kB Writeback: 0 kB Mapped: 42236 kB Slab: 25912 kB Committed_AS: 118680 kB PageTables: 1236 kB VmallocTotal: 3874808 kB VmallocUsed: 1416 kB VmallocChunk: 3872908 kB HugePages_Total: 0 HugePages_Free: 0 Hugepagesize: 4096 kB
Much of the information here is used by the
free
, top
, and ps
commands. In fact, the output of the free
command is similar in appearance to the contents and structure of /proc/meminfo
. But by looking directly at /proc/meminfo
, more details are revealed:
-
MemTotal
— Total amount of physical RAM, in kilobytes. -
MemFree
— The amount of physical RAM, in kilobytes, left unused by the system. -
Buffers
— The amount of physical RAM, in kilobytes, used for file buffers. -
Cached
— The amount of physical RAM, in kilobytes, used as cache memory. -
SwapCached
— The amount of swap, in kilobytes, used as cache memory. -
Active
— The total amount of buffer or page cache memory, in kilobytes, that is in active use. This is memory that has been recently used and is usually not reclaimed for other purposes. -
Inactive
— The total amount of buffer or page cache memory, in kilobytes, that are free and available. This is memory that has not been recently used and can be reclaimed for other purposes. -
HighTotal
andHighFree
— The total and free amount of memory, in kilobytes, that is not directly mapped into kernel space. TheHighTotal
value can vary based on the type of kernel used. -
LowTotal
andLowFree
— The total and free amount of memory, in kilobytes, that is directly mapped into kernel space. TheLowTotal
value can vary based on the type of kernel used. -
SwapTotal
— The total amount of swap available, in kilobytes. -
SwapFree
— The total amount of swap free, in kilobytes. -
Dirty
— The total amount of memory, in kilobytes, waiting to be written back to the disk. -
Writeback
— The total amount of memory, in kilobytes, actively being written back to the disk. -
Mapped
— The total amount of memory, in kilobytes, which have been used to map devices, files, or libraries using themmap
command. -
Slab
— The total amount of memory, in kilobytes, used by the kernel to cache data structures for its own use. -
Committed_AS
— The total amount of memory, in kilobytes, estimated to complete the workload. This value represents the worst case scenario value, and also includes swap memory. -
PageTables
— The total amount of memory, in kilobytes, dedicated to the lowest page table level. -
VMallocTotal
— The total amount of memory, in kilobytes, of total allocated virtual address space. -
VMallocUsed
— The total amount of memory, in kilobytes, of used virtual address space. -
VMallocChunk
— The largest contiguous block of memory, in kilobytes, of available virtual address space. -
HugePages_Total
— The total number of hugepages for the system. The number is derived by dividingHugepagesize
by the megabytes set aside for hugepages specified in/proc/sys/vm/hugetlb_pool
. This statistic only appears on the x86, Itanium, and AMD64 architectures. -
HugePages_Free
— The total number of hugepages available for the system. This statistic only appears on the x86, Itanium, and AMD64 architectures. -
Hugepagesize
— The size for each hugepages unit in kilobytes. By default, the value is 4096 KB on uniprocessor kernels for 32 bit architectures. For SMP, hugemem kernels, and AMD64, the default is 2048 KB. For Itanium architectures, the default is 262144 KB. This statistic only appears on the x86, Itanium, and AMD64 architectures.
相关推荐
LINUX 负载LINUX 负载LINUX 负载LINUX 负载LINUX 负载
基于CPU和内存利用率的负载均衡算法的研究.pdf
通过定时 crontab -e 任务,执行脚本,监测服务器的cpu,内存,磁盘,负载,超出预定的值时发邮件到自己的邮箱告警,很好的提前预防服务器的资源紧张问题。
通过Java程序获取Windows/Linux系统的CPU信息、内存信息、硬盘信息、网络信息、操作系统信息等。
wgcloud支持显示CPU利用率、CPU温度、内存利用率、磁盘容量、磁盘IO、硬盘智能健康状态、系统负载、连接数、网卡流量、硬件系统信息等。 支持进程应用、文件、端口、服务器上的日志、docker容器、数据库、数据表等...
linux 排查cpu负载过高异常,找到最耗CPU的进程,找到最耗CPU的线程,将线程PID转化为16进制
Linux系统cpu,内存高负载排查-云主机-产品文档-帮助文档-京东云
利用shell脚本来监控linux系统的负载、CPU、内存、硬盘、用户登录数,在没有nagios监控的情况下,只要服务器能上互联网,就可通过发邮件的方式来提醒管理员系统资源的使用情况。
Apache+Tomcat+Linux集群和均衡负载(Session同步复制
LINUX下查看CPU负载的所有命令.docxLINUX下查看CPU负载的所有命令.docx
高考网上信息采集中Linux平台下DNS负载均衡技术浅析.pdf
测试cpu负荷性能的原理主要是通过求PI的小数点后面的位数来分析的
这里要实现的是通过python调用top命令,并获得cpu的利用率信息。 用过popen的朋友很快就能想到类似如下的代码(这个是我第一次写的代码,*_*): 复制代码 代码如下: #! /usr/bin/python import
基于Linux虚拟服务器的负载均衡 方案与步骤
linux 服务器集群与负载均衡技术,收藏多种文档...
Linux下实现集群负载均衡.pdf
基于Linux系统的DHCP负载服务器建设.pdf
查看指定进程的cpu和内存使用情况(与任务管理器查看一样)
以上分析可以看出,一台机器很有可能处于低cpu使用率高负载的情况,因此看机器的繁忙程度应该结合两者,从实际的使用情况观察,自己的一台双核志强2.8GHZ,2G内存的机器在平均负载到50左右,cpu使用率才接近100%