认识Warden中的性能指标

来源:互联网 发布:手机淘宝怎样改好评 编辑:程序博客网 时间:2024/06/04 18:54

先温故一段基础知识:

Linux vmstat命令详解:http://blog.csdn.net/ithomer/article/details/8674830

内存工作原理:

在系统中运行的每个进程都需要使用到内存,但不是每个进程都需要每时每刻使用系统分配的内存空间。当系统运行所需内存超过实际的物理内存,内核会释放某些进程所占用但未使用的部分或所有物理内存,将这部分资料存储在磁盘上直到进程下一次调用,并将释放出的内存提供给有需要的进程使用。

在Linux内存管理中,主要是通过“调页Paging”和“交换Swapping”来完成上述的内存调度。调页算法是将内存中最近不常使用的页面换到磁盘上,把活动页面保留在内存中供进程使用。交换技术是将整个进程,而不是部分页面,全部交换到磁盘上。

分页(Page)写入磁盘的过程被称作Page-Out,分页(Page)从磁盘重新回到内存的过程被称作Page-In。当内核需要一个分页时,但发现此分页不在物理内存中(因为已经被Page-Out了),此时就发生了分页错误(Page Fault)。

当系统内核发现可运行内存变少时,就会通过Page-Out来释放一部分物理内存。尽管Page-Out不是经常发生,但是如果Page-out频繁不断的发生,直到当内核管理分页的时间超过运行程式的时间时,系统效能会急剧下降。这时的系统已经运行非常慢或进入暂停状态,这种状态亦被称作thrashing(颠簸)。


关于pagein 、pageout和pagefault


When pages are written to disk, the event is called a page-out, and when pages are returned to physical memory, the event is called a page-in. 


A page fault occurs when the kernel needs a page, finds it doesn't exist in physical memory because it has been paged-out, and re-reads it in from disk.


Page-ins are common, normal and are not a cause for concern. For example, when an application first starts up, its executable image and data are paged-in. This is normal behavior.


Page-outs, however, can be a sign of trouble. When the kernel detects that memory is running low, it attempts to free up memory by paging out. Though this may happen briefly from time to time, if page-outs are plentiful and constant, the kernel can reach a point where it's actually spending more time managing paging activity than running the applications, and system performance suffers. This woeful state is referred to as thrashing.





单位是Bytes 还是 KBytes?


memory_stat.cache : 296189952

Cache大小为296189952byetes 约 282MB


memory_stat.rss : 77824
rss:resident set size, the non-swapped physical memory that a task has used (in kiloBytes)

memory_stat.mapped_file : 0


memory_stat.pgpgin : 198278
从磁盘调入到内存的页数

memory_stat.pgpgout : 125947
从内存写到磁盘的页数

memory_stat.swap : 0
从内存与磁盘的交换分区

memory_stat.pgfault : 139165


memory_stat.pgmajfault : 0


memory_stat.inactive_anon : 4096


memory_stat.active_anon : 77824
memory_stat.inactive_file : 265687040
memory_stat.active_file : 30498816
memory_stat.unevictable : 0
memory_stat.hierarchical_memory_limit : 9223372036854775807
memory_stat.hierarchical_memsw_limit : 9223372036854775807
memory_stat.total_cache : 296189952
memory_stat.total_rss : 77824
memory_stat.total_mapped_file : 0
memory_stat.total_pgpgin : 198278
memory_stat.total_pgpgout : 125947
memory_stat.total_swap : 0
memory_stat.total_pgfault : 139165
memory_stat.total_pgmajfault : 0
memory_stat.total_inactive_anon : 4096
memory_stat.total_active_anon : 77824
memory_stat.total_inactive_file : 265687040
memory_stat.total_active_file : 30498816
memory_stat.total_unevictable : 0
cpu_stat.usage : 65698048029
cpu_stat.user : 6093
cpu_stat.system : 230
disk_stat.bytes_used : 300838912
disk_stat.inodes_used : 3242
bandwidth_stat.in_rate : 4294967295
bandwidth_stat.in_burst : 4294967295
bandwidth_stat.out_rate : 4294967295
bandwidth_stat.out_burst : 4294967295

原创粉丝点击