Closed jflorian closed 7 years ago
Personally do not have experience with desktop use-cases for Tuned. My team's focus is on the server profiles. Perhaps @yarda could take a peek?
I'd like this for desktop use also, but this case is actually for a Bacula server. Most of the day it's dormant so I'd like the drives to spin down until the backups are to be run again. Here the iSCSI target provides the Bacula server with its storage pool for the disk-based backup volumes. This particular example may be moot because the iSCSI target also provides storage for Bacula's PostgreSQL database and that service seems to keept the drive awake regardless.
Nevertheless, I'm still very curious for the more typical desktop case if/how tuned can help.
I ran into this bug myself. At least in my case, it is caused by the fact that every time 'hdparm -S' is run on the drive, the drive spins up. And because tuned, with dynamic tunings enabled, updates the tuning and runs hdparm every couple of seconds, the drive actually keeps spinning up and down.
I worked around this by creating my own tuned profile, where I manualy set the spindown time, and then I globally disabled dynamic tuning (/etc/tuned/tuned-main.conf). This works for me, as I want the drive in standby mode all the time. But I guess this might not be appropriate in your case.
Maybe we could "solve" this by providing less power levels in the disk plugin, so that tuned runs hdparm less frequently: https://github.com/redhat-performance/tuned/blob/master/tuned/plugins/plugin_disk.py#L20
Unfortunately I do not have rotary disk handy to check it, but if hdparm -S is always waking up the drive we should probably:
@yarda, I put up PR#31 dealing with the last point you mentioned.
@jflorian, Can you test this? It does fix the issue for me, but there might be another problem, because even without this change you should see the spindown after at most 10 minutes (when tuned reaches the most powersaving level), if the drive is completely idle.
@jflorian Okay, I guess I should have asked about the more obvious things, before associating this with a different issue I found (but hey, at least I helped myself :)).
Yarda told me yesterday, that dynamic tuning is disabled by default in RHEL. Also, there's nothing in the default balanced profile, that should cause the disk to spindown. So two questions:
If you're using the default configuration, there's no reason the drive should spin down. Where did you learn the information that it should?
My understanding is that hdd spindown should occur automatically with the
balanced
profile, right? I have a simple setup where CentOS 7 is installed on sda and sdb/sdc are joined with LVM to make an iSCSI target (using tgtd). To rule out disk activity keeping sd[bc] spun up, I've stopped the tgtd service so these two drives should be completely idle. Yet, whenever I query them:With tuned, I shouldn't need to set spindown with hdparm myself, correct? I've only started digging into the code, but something tells me I missed something essential and basic.