Linux-bcache Archive mirror
 help / color / mirror / Atom feed
From: benard_bsc@outlook.com
To: linux-bcache@vger.kernel.org
Subject: Bcache btree cache size bug
Date: Thu, 09 Feb 2023 12:22:47 +0000	[thread overview]
Message-ID: <LO0P265MB45742A9C654C2EB4EB3775CEEFD99@LO0P265MB4574.GBRP265.PROD.OUTLOOK.COM> (raw)

I believe I have found a bug in bcache where the btree grows out of
control and makes operations like garbage collection take a very large
amount of time affecting client IO. I can see periodic periods where
bcache devices stop responding to client IO and the cache device starts
doing a lage amount of reads. In order to test the above I triggered gc
manually using 'echo 1 > trigger_gc' and observing the cache set. Once
again a large amount of reads start happening on the cache device and
all the bcache devices of that cache set stop responding. I believe
this is becouse gc blocks all client IO while its happening (might be
wrong). Checking the stats I can see that the
'btree_gc_average_duration_ms'  is almost 2 minutes
(btree_gc_average_duration_ms) which seems excessively large to me.
Furthermore doing something like checking bset_tree_stats will just
hang and cause a similar performance impact. 

An interesting thing to note is that after garbage collection the
number of btree nodes is lower but the btree cache actually grows in
size.

Example:
/sys/fs/bcache/c_set# cat btree_cache_size 
5.2G
/sys/fs/bcache/c_set# cat internal/btree_nodes 
28318
/sys/fs/bcache/c_set# cat average_key_size 
25.2k

Just for reference I have a similar environment (which is busier and
has more data stored) which doesnt experience this issue and the
numbers for the above are:
/sys/fs/bcache/c_set# cat btree_cache_size 
840.5M
/sys/fs/bcache/c_set# cat internal/btree_nodes 
3827
/sys/fs/bcache/c_set# cat average_key_size 
88.3k

Kernel version: 5.4.0-122-generic
OS version: Ubuntu 18.04.6 LTS
bcache-tools package: 1.0.8-2ubuntu0.18.04.1

I am able to provide more info if needed
Regards


             reply	other threads:[~2023-02-09 12:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 12:22 benard_bsc [this message]
2023-02-09 16:07 ` Bcache btree cache size bug Andrea Tomassetti
2023-02-10 10:44   ` benard_bsc
2023-05-04 14:38     ` Benard Bsc
2023-05-05  2:48       ` Coly Li

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=LO0P265MB45742A9C654C2EB4EB3775CEEFD99@LO0P265MB4574.GBRP265.PROD.OUTLOOK.COM \
    --to=benard_bsc@outlook.com \
    --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).