The pagedaemon scanned the page cache and set the MMU reference bit if dirty page finds. When the fsflush daemon run, it scans the page cache looking for pages with the MMU reference bit set, and schedules these pages to be written to disk. Since all cached data flushed from memory to disk, it will prevent data lost in case the computer crash.
fsflush is governed by 2 tuneable parameter, tune_t_fsflushr and autoup. The flushrate (set by tune_t_fsflushr) is how often the daemon runs, while autoup determine the maximum age of a page (in seconds). By default flushrate have set to 5, and autoup 30. Its mean the daemon will run every 5 seconds, and flushing 1/6 portion of memory until it has covered all dirty pages in 30 seconds. We can make the flushrate smaller and increase the maximum age to spread out the flush load. Basically, the less frequent the flushing, the faster the computer, but risk losing data more. More flushing, slower computer (more CPU cycles for flushing) but less risk losing data.
fsflush is governed by 2 tuneable parameter, tune_t_fsflushr and autoup. The flushrate (set by tune_t_fsflushr) is how often the daemon runs, while autoup determine the maximum age of a page (in seconds). By default flushrate have set to 5, and autoup 30. Its mean the daemon will run every 5 seconds, and flushing 1/6 portion of memory until it has covered all dirty pages in 30 seconds. We can make the flushrate smaller and increase the maximum age to spread out the flush load. Basically, the less frequent the flushing, the faster the computer, but risk losing data more. More flushing, slower computer (more CPU cycles for flushing) but less risk losing data.
Below is a picture of fsflush daemon in busy system:
root@sun1: uptime
10:55am up 30 day(s), 21:36 7 users, load average: 21.62, 22.49, 23.37
root@sun1: # sysdef
snip
* Tunable Parameters
30 auto update time limit in seconds (NAUTOUP)
1 fsflush run rate (FSFLUSHR)
snip
root@sun1: ps -ef
UID PID PPID C STIME TTY TIME CMD
root 0 0 0 Mar 07 ? 0:01 sched
root 1 0 0 Mar 07 ? 36:03 /etc/init -
root 2 0 0 Mar 07 ? 0:00 pageout
root 3 0 0 Mar 07 ? 2470:17 fsflush
root 431 1 0 Mar 07 ? 1:33 /usr/lib/inet/in.mpathd -a
root 11 1 0 Mar 07 ? 0:00 /platform/SUNW,Sun-Fire-15000
root 130 1 0 Mar 07 ? 0:02 devfsadmd
root 719 1 0 Mar 07 ? 5:01 /usr/sbin/inetd -s -t
root 19907 1 0 Mar 08 ? 1:45 /usr/sbin/cron
root 785 1 0 Mar 07 ? 47:35 /usr/sbin/nscd
root 747 1 0 Mar 07 ? 2:51 /usr/sbin/syslogd
smmsp 992 1 0 Mar 07 ? 0:00 /usr/lib/sendmail -Ac -q15m
root 2534 1 0 Mar 07 ? 0:00 ./rasserv -d /opt/SUNWstade
root 2828 1 0 Mar 07 ? 32:43 /usr/local/sbin/snmpd
nobody 2799 2677 0 Mar 07 ? 0:08 /usr/apache/bin/httpd
root 2864 2853 0 Mar 07 ? 0:00 /usr/lib/saf/ttymon
oracle 2647 1 0 Mar 24 ? 224:32 ora_pmon_mspro
oracle 4053 4052 0 Mar 07 ? 498:07 /oracle/am1/bin/am1agent
oracle 2668 1 0 Mar 24 ? 64:23 ora_lgwr_mspro
oracle 2676 1 0 Mar 24 ? 50:18 ora_cjqa_mspro
oracle 2672 1 0 Mar 24 ? 24:27 ora_smon_mspro
oracle 2670 1 0 Mar 24 ? 114:32 ora_ckpt_mspro
oracle 28396 1 0 07:10:05 ? 12:48 oraclemspro (LOCAL=NO)
oracle 17848 1 0 07:52:10 ? 0:15 oraclemspro (LOCAL=NO)
oracle 3158 1 0 Mar 24 ? 136:51 ora_arc_mspro
snip
With tunable parameter set to:
autoup=30
tune_t_fsflushr=1
Its shown that fsflush dominated CPU usage. We may able to reduce fsflush CPU usage by modify /etc/system and reboot the server afterward.
set autoup=900set tune_t_fsflushr=1
No comments:
Post a Comment