web server部署的是apache,同时还跑着memcached和cabinet server。

最近页面打开比较慢,经查看,web server 的cpu、load以及数据库服务器的cpu、load、memory都很正常。但是web server 8g的内存即将消耗尽。将memcached迁移走,页面响应明显变快。

————————————————————

另外,sar -B 看到,page faults达到每秒15000左右,但是page in 和page out都不高。page faults是包括Minor page fault和Major page fault的。If the page is loaded in memory at the time the fault is generated, but is not marked in the memory management unit as being loaded in memory, then it is called a minor or soft page fault.If the page is not loaded in memory at the time the fault is generated, then it is called a major or hard page fault.

缺页中断可分为主缺页中断(Major Page Fault)和次缺页中断(Minor Page Fault),要从磁盘读取数据而产生的中断是主缺页中断;数据已经被读入内存并被缓存起来,从内存缓存区中而不是直接从硬盘中读取数据而产生的中断是次缺页中断。

我的猜测是,既然page in和out都不高,说明硬盘与内存间的page交换不多?而大多数是从内存cache里读入到可用区域的中断?所以,这样的中断次数,是可以接受的?

———————————

[admin@v080049 ~]$ /usr/bin/time -v date
2011年 10月 31日 星期一 18:32:36 CST
Command being timed: “date”
User time (seconds): 0.00
System time (seconds): 0.00
Percent of CPU this job got: 0%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 0
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 225
Voluntary context switches: 1
Involuntary context switches: 1
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

Leave a Reply