Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2294330
  • 博文数量: 276
  • 博客积分: 5998
  • 博客等级: 大校
  • 技术积分: 5175
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-24 14:43
文章分类

全部博文(276)

文章存档

2014年(25)

2013年(11)

2012年(69)

2011年(167)

2010年(4)

分类: LINUX

2011-12-27 09:53:54

kswapd0,kjournald,pdflush 是干嘛的? - [linux]
Tag:linux 进程

:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://ri0day.blogbus.com/logs/46707525.html

以前服务器不忙的时候没有发现这几个进程,自从装了2个mysql以后,负载跑起来了,发现有几个不知道作用的进程,

google之后,记之

290 root      10  -5     0    0    0 S    1  0.0   1:40.26 kswapd0

1969 root      10  -5     0    0    0 D    0  0.0 165:27.61 kjournald

19080 root      15   0     0    0    0 S    0  0.0   0:21.40 pdflush

1.kswapd0

Linux uses kswapd for virtual memory management such that pages that have been recently accessed are kept in memory and less active pages are paged out to disk.
(what is a page?)…Linux uses manages memory in units called pages.
So,the kswapd process regularly decreases the ages of unreferenced pages…and at the end they are paged out(moved out) to disk

系统每过一定时间就会唤醒kswapd,看看内存是否紧张,如果不紧张,则睡眠,kswapd中,有2个阀值,pages_higepages_low,当空闲内存页的数量低于pages_low的时候,kswapd进程就会扫描内存并且每次释放出32free pages,直到free page的数量到达pages_high.

2.kjournald

EXT3文件系统的日志进程,具有3种模式:

journal - logs all filesystem data and metadata changes. The slowest of the three ext3 journaling modes, this journaling mode minimizes the chance of losing the changes you have made to any file in an ext3 filesystem.(记录所有文件系统上的元数据改变,最慢的一种模式,)

ordered - only logs changes to filesystem metadata, but flushes file data updates to disk before making changes to associated filesystem metadata. This is the default ext3 journaling mode.(默认使用的模式,只记录文件系统改变的元数据,并在改变之前记录日志)

writeback - only logs changes to filesystem metadata but relies on the standard filesystem write process to write file data changes to disk. This is the fastest ext3 journaling mode.(最快的一种模式,同样只记录修改过的元数据,依赖标准文件系统写进程将数据写到硬盘)

修改模式EXT3的工作模式;

vim /etc/fstab

/dev/hda5 /opt ext3 data=writeback 1 0

详细介绍:

3.pdflush

pdflush用于将内存中的内容和文件系统进行同步,比如说,当一个文件在内存中进行修改,pdflush负责将它写回硬盘.每当内存中的垃圾页(dirty page)超过10%的时候,pdflush就会将这些页面备份回硬盘.这个比率是可调节的,通过/etc/sysctl.conf中的 vm.dirty_background_ratio项 默认值为10 也可以

cat /proc/sys/vm/dirty_background_ratio 查看当前的值



阅读(1942) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~