From: " " <Cedric.dewijs@eclipso.eu>
To: <linux-bcache@vger.kernel.org>
Subject: configure bcache for preventing IO to a HDD to save power / noise
Date: Fri, 30 Jun 2023 12:08:51 +0200 [thread overview]
Message-ID: <1be1562c9792cf8c036e4c7485047fd3@mail.eclipso.de> (raw)
I have 4 HDD's, and 4 SSD's. Each HDD is cached by it's own SSD. The 4 HDD/SSD stacks are used to create a btrfs raid system as described here:
https://wiki.archlinux.org/title/Bcache#Situation:_3_hard_drives_and_3_read/write_cache_SSD's
I want the hard drives to stay idle, so they don't spin, don't consume power and be silent.
I would like to configure bcache like this:
1) Never write to the hard drive, unless there's (almost) no room on the SSD anymore.
2) Avoid reading from the HDD, so cache everything that has been read from the HDD.
3) When a cache miss occurs, wake up the HDD, and read from there.
4) After a cache miss, write all the dirty data from the SSD to the HDD until there's no dirty data anymore.
5) When both reading and writing data to the HDD, prioritize reading.
i've tried these settings to avoid write access to the HDD:
echo 0 > /sys/fs/bcache/<uuid>/congested_read_threshold_us
echo 0 > /sys/fs/bcache/<uuid>/congested_write_threshold_us
echo writeback > /sys/block/bcache3/bcache/cache_mode
echo 0 > /sys/block/bcache0/bcache/sequential_cutoff
With the above settings, all the writes first go to the SSD's, but then they are almost immediately flushed into the HDD.
echo 90 > /sys/block/bcache0/bcache/writeback_percent
With this setting I hoped the writes to the HDD would stop until the SSD was almost full. This percentage is clipped to 40%, so most of the SSD can't be used as a write cache. Also there were still writes into the HDD:
# cat /sys/block/bcache0/bcache/writeback_percent
40
With this setting I don't see writes to the HDD anymore: What happens when the amount of dirty data is over 40% while the delay has not yet expired?
echo 100000 > /sys/block/bcache0/bcache/writeback_delay
How can I configure bcache so the HDD's are idle for as long as possible?
________________________________________________________
Your E-Mail. Your Cloud. Your Office. eclipso Mail & Cloud. https://www.eclipso.eu
reply other threads:[~2023-06-30 10:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1be1562c9792cf8c036e4c7485047fd3@mail.eclipso.de \
--to=cedric.dewijs@eclipso.eu \
--cc=linux-bcache@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).