From: Kai Krakow <kai@kaishome.de>
To: Santiago Castillo Oli <scastillo@aragon.es>
Cc: Coly Li <colyli@suse.de>, linux-bcache@vger.kernel.org
Subject: Re: Low hit ratio and cache usage
Date: Fri, 4 Jun 2021 17:56:44 +0200 [thread overview]
Message-ID: <CAC2ZOYuUbrRgHjFqERMQ8N2NUuDnySbcpvtaCzHGWGTnnZU7_w@mail.gmail.com> (raw)
In-Reply-To: <62f20c57-d502-c362-da84-61a47c891e6d@aragon.es>
Hello!
Am Fr., 4. Juni 2021 um 14:36 Uhr schrieb Santiago Castillo Oli
<scastillo@aragon.es>:
>
> Hi Coli!
>
>
> El 04/06/2021 a las 14:05, Coly Li escribió:
> > What is the kernel version and where do you have the kernel ? And what
> > is the workload on your machine ?
>
> I'm using debian 10 with default debian kernel (4.19.0-16-amd64) in host
> and guests.
>
> For virtualization I'm using KVM.
>
>
> There is a host, where bcache is running. The filesystem over bcache
> device is ext4. In that filesystem there is only 9 qcow2 files user by
> three VM guests. Two VM are running small nextcloud instances, another
> one is running transmission (bittorrent) for feeding debian and other
> distro iso files (30 files - 60 GiB approx.)
Besides Coly recommending to use a newer kernel, I think there may be
some misunderstanding of how bcache works:
* bcache is mostly about reducing latency so it skips sequential
access, you should measure block access latency instead of throughput
or fill rate
* thus, it probably fills your cache very slowly if a lot of patterns
are sequential
* ext4 has a write journal which turns many random write patterns into
sequential write patterns, YMMV if you disable ordered data mode or
journalling
* qcow2 is copy-on-write: new blocks are appended, resulting in
possible write amplification in bcache, it also creates sequential
write patterns
* kvm/qemu probably use directio / uncached IO by default which may
bypass bcache or caching completely, you should try a different IO
mode in kvm (e.g. unsafe cached)
Regards,
Kai
next prev parent reply other threads:[~2021-06-04 15:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-04 11:07 Low hit ratio and cache usage Santiago Castillo Oli
2021-06-04 12:05 ` Coly Li
2021-06-04 12:35 ` Santiago Castillo Oli
2021-06-04 12:59 ` Coly Li
2021-06-04 15:56 ` Kai Krakow [this message]
[not found] ` <f25c7f91-433e-d699-c1f6-7e828023167f@orange.fr>
2021-06-04 12:12 ` Santiago Castillo Oli
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=CAC2ZOYuUbrRgHjFqERMQ8N2NUuDnySbcpvtaCzHGWGTnnZU7_w@mail.gmail.com \
--to=kai@kaishome.de \
--cc=colyli@suse.de \
--cc=linux-bcache@vger.kernel.org \
--cc=scastillo@aragon.es \
/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 NNTP newsgroup(s).