Re: Hard drive spindown: root drive wakes frequently
I've let it run overnight. I checked the output of btrace. It's weird... exactly every hour, syslogd wakes the drive. It's weird because
1) it can't be the cache flushing, because I set that to 5 hours:
2) syslogd should write to /var/log, right? And now /var/log is in RAM. It would be nice to know which files are being written, but btrace doesn't say.
Here's the output of one of those "hourly sessions":
So, first syslogd does something at the 3915 second (why to sda and not to ram0?), completing the write after 5 seconds (at 3920); then another 5 seconds later pdflush commits some changes (why 5 seconds? I set it to 5 hours!), and swapper does something too.
The system was also woken once, by apt-get and mlocate. That might be a daily cron thing, I still haven't checked, but I don't mind it running once a day. I plan on waking the drive everyday anyway, to do some "house-keeping", checks on hard drives, syncing of data, and so on.
An hourly wake-up, on the other hand, adds at least 24 startups-spindowns/day to the drive, and that's not healthy! I would really like to stop those hourly wake-ups. Or at least, make them happen at most twice a day or so... Any ideas?
Thanks again
Cristian
EDIT: Maybe I know why pdflush writes. I enabled "laptop mode", so that everytime the drive wakes for some reason, pdflush takes the opportunity to flush its cache, to save another startup when its cache would otherwise expire. If this is true, then the only "culprit" would be syslogd initiating a write to /dev/sda...
EDIT 2: I checked /etc/cron.hourly. It's empty. There is something on /etc/cron.daily, and some of those things I might remove, but cron.hourly is empty.
EDIT 3: Sorry for all these edits but I'm constantly finding new things. I saw that on /etc/crontab there's an hourly entry. It said
What does run-parts do? Could that be the culprit? I changed that to happen daily, just before the other daily task. I'll leave it running for another 2-3 hours now, and see if anything changed...
I've let it run overnight. I checked the output of btrace. It's weird... exactly every hour, syslogd wakes the drive. It's weird because
1) it can't be the cache flushing, because I set that to 5 hours:
Code:
cristian@server:~$ cat /proc/sys/vm/dirty_expire_centisecs 1800112 cristian@server:~$
Here's the output of one of those "hourly sessions":
Code:
8,0 0 4091 3915.026812622 4732 A W 1508511 + 8 <- (8,1) 1508448 8,0 0 4092 3915.026816813 4732 Q W 1508511 + 8 [syslogd] 8,0 0 4093 3915.026835531 4732 G W 1508511 + 8 [syslogd] 8,0 0 4094 3915.026849221 4732 P N [syslogd] 8,0 0 4095 3915.026855647 4732 I W 1508511 + 8 [syslogd] 8,0 0 4096 3915.026903980 4732 A W 524927 + 8 <- (8,1) 524864 8,0 0 4097 3915.026907612 4732 Q W 524927 + 8 [syslogd] 8,0 0 4098 3915.026921022 4732 G W 524927 + 8 [syslogd] 8,0 0 4099 3915.026927727 4732 I W 524927 + 8 [syslogd] 8,0 0 4100 3915.026940858 4732 U N [syslogd] 2 8,0 0 4101 3915.026962091 4732 D W 1508511 + 8 [syslogd] 8,0 0 4102 3915.027069094 4732 D W 524927 + 8 [syslogd] 8,0 0 4103 3920.267825750 0 C W 1508511 + 8 [0] 8,0 0 4104 3920.268825934 0 C W 524927 + 8 [0] [...] (the block above repeats for 5 times, always in the 3920 second) 8,0 0 4161 3925.272156977 136 A W 63 + 8 <- (8,1) 0 8,0 0 4162 3925.272160888 136 Q W 63 + 8 [pdflush] 8,0 0 4163 3925.272174857 136 G W 63 + 8 [pdflush] 8,0 0 4164 3925.272185474 136 P N [pdflush] 8,0 0 4165 3925.272190502 136 I W 63 + 8 [pdflush] 8,0 0 4166 3925.272212574 136 A W 71 + 8 <- (8,1) 8 8,0 0 4167 3925.272216206 136 Q W 71 + 8 [pdflush] 8,0 0 4168 3925.272225425 136 M W 71 + 8 [pdflush] 8,0 0 4169 3925.272240232 136 A W 524351 + 8 <- (8,1) 524288 8,0 0 4170 3925.272243585 136 Q W 524351 + 8 [pdflush] 8,0 0 4171 3925.272252246 136 G W 524351 + 8 [pdflush] 8,0 0 4172 3925.272258671 136 I W 524351 + 8 [pdflush] 8,0 0 4173 3925.272275434 136 A W 524359 + 8 <- (8,1) 524296 8,0 0 4174 3925.272279066 136 Q W 524359 + 8 [pdflush] 8,0 0 4175 3925.272286051 136 M W 524359 + 8 [pdflush] 8,0 0 4176 3925.272299740 136 A W 524527 + 8 <- (8,1) 524464 8,0 0 4177 3925.272303931 136 Q W 524527 + 8 [pdflush] 8,0 0 4178 3925.272312313 136 G W 524527 + 8 [pdflush] 8,0 0 4179 3925.272319018 136 I W 524527 + 8 [pdflush] 8,0 0 4180 3925.272336898 136 A W 524687 + 8 <- (8,1) 524624 8,0 0 4181 3925.272340530 136 Q W 524687 + 8 [pdflush] 8,0 0 4182 3925.272349191 136 G W 524687 + 8 [pdflush] 8,0 0 4183 3925.272355058 136 I W 524687 + 8 [pdflush] 8,0 0 4184 3925.272375453 136 D W 63 + 16 [pdflush] 8,0 0 4185 3925.272462620 136 D W 524351 + 16 [pdflush] [...] repeats for a while, still on the 3925 second... 8,0 0 4219 3925.273443527 0 C W 63 + 16 [0] 8,0 0 4220 3925.273556117 0 D W 524527 + 8 [swapper] 8,0 0 4221 3925.273989717 0 C W 524351 + 16 [0] 8,0 0 4222 3925.274088338 0 D W 524687 + 8 [swapper] 8,0 0 4223 3925.274355706 0 C W 524527 + 8 [0] 8,0 0 4224 3925.274463268 0 D W 569983 + 8 [swapper] 8,0 0 4225 3925.274687611 0 C W 524687 + 8 [0] 8,0 0 4226 3925.274787350 0 D W 571231 + 48 [swapper] 8,0 0 4227 3925.274848534 136 A W 524687 + 8 <- (8,1) 524624 8,0 0 4228 3925.274853284 136 Q W 524687 + 8 [pdflush] 8,0 0 4229 3925.274866415 136 G W 524687 + 8 [pdflush] 8,0 0 4230 3925.274875355 136 I W 524687 + 8 [pdflush] 8,0 0 4231 3925.274896029 136 A W 524927 + 8 <- (8,1) 524864 8,0 0 4232 3925.274899661 136 Q W 524927 + 8 [pdflush] 8,0 0 4233 3925.274909160 136 G W 524927 + 8 [pdflush] 8,0 0 4234 3925.274915865 136 I W 524927 + 8 [pdflush] 8,0 0 4235 3925.274933746 136 A W 524935 + 8 <- (8,1) 524872 8,0 0 4236 3925.274937378 136 Q W 524935 + 8 [pdflush] 8,0 0 4237 3925.274946038 136 M W 524935 + 8 [pdflush] 8,0 0 4238 3925.274961125 136 A W 526327 + 8 <- (8,1) 526264 8,0 0 4239 3925.274965316 136 Q W 526327 + 8 [pdflush] 8,0 0 4240 3925.274974535 136 G W 526327 + 8 [pdflush] 8,0 0 4241 3925.274980682 136 I W 526327 + 8 [pdflush] 8,0 0 4242 3925.274992136 136 U N [pdflush] 11 8,0 0 4243 3925.275062820 0 C W 569983 + 8 [0] 8,0 0 4244 3925.275159486 0 D W 641327 + 8 [swapper] 8,0 0 4245 3925.276349370 0 C W 571231 + 48 [0] 8,0 0 4246 3925.276450226 0 D W 697743 + 8 [swapper] 8,0 0 4247 3925.276714241 0 C W 641327 + 8 [0] 8,0 0 4248 3925.276806437 0 D W 783799 + 8 [swapper] 8,0 0 4249 3925.277046146 0 C W 697743 + 8 [0] 8,0 0 4250 3925.277138621 0 D W 1508311 + 8 [swapper] 8,0 0 4251 3925.277373581 0 C W 783799 + 8 [0] 8,0 0 4252 3925.277465777 0 D W 3408143 + 8 [swapper] 8,0 0 4253 3925.277704089 0 C W 1508311 + 8 [0] 8,0 0 4254 3925.277800475 0 D W 3604815 + 8 [swapper] 8,0 0 4255 3925.278067005 0 C W 3408143 + 8 [0] 8,0 0 4256 3925.278175963 0 D W 524687 + 8 [swapper] 8,0 0 4257 3925.278249441 136 U N [pdflush] 4 8,0 0 4258 3925.278436067 0 C W 3604815 + 8 [0] 8,0 0 4259 3925.278529381 0 D W 524927 + 16 [swapper] 8,0 0 4260 3925.278806247 0 C W 524687 + 8 [0] 8,0 0 4261 3925.278906266 0 D W 526327 + 8 [swapper] 8,0 0 4262 3925.278952922 136 U N [pdflush] 2 8,0 0 4263 3925.279360819 0 C W 524927 + 16 [0] 8,0 0 4264 3925.279499392 136 U N [pdflush] 1 8,0 0 4265 3925.279737145 0 C W 526327 + 8 [0]
The system was also woken once, by apt-get and mlocate. That might be a daily cron thing, I still haven't checked, but I don't mind it running once a day. I plan on waking the drive everyday anyway, to do some "house-keeping", checks on hard drives, syncing of data, and so on.
An hourly wake-up, on the other hand, adds at least 24 startups-spindowns/day to the drive, and that's not healthy! I would really like to stop those hourly wake-ups. Or at least, make them happen at most twice a day or so... Any ideas?
Thanks again
Cristian
EDIT: Maybe I know why pdflush writes. I enabled "laptop mode", so that everytime the drive wakes for some reason, pdflush takes the opportunity to flush its cache, to save another startup when its cache would otherwise expire. If this is true, then the only "culprit" would be syslogd initiating a write to /dev/sda...
EDIT 2: I checked /etc/cron.hourly. It's empty. There is something on /etc/cron.daily, and some of those things I might remove, but cron.hourly is empty.
EDIT 3: Sorry for all these edits but I'm constantly finding new things. I saw that on /etc/crontab there's an hourly entry. It said
Code:
17 * * * * root cd / && run-parts --report /etc/cron.hourly
Comment