librbd caches data at a buffer / block level. In a simplified example, if you
are reading and writing random 4K blocks, the librbd cache would store only
those individual 4K blocks. Behind the scenes, it is possible for adjacent
block buffers to be merged together within the librbd cache. Therefore, if you
read a whole object worth of adjacent blocks, the whole object could be stored
in the cache as a single entry due to merging -- assuming no cache trimming
occurred to evict blocks.
When a flush occurs, only buffers that are flagged as dirty written are written
back to the OSDs. The whole object would not be written to the OSDs unless you
wrote data to the whole object.
--
Jason Dillaman
Red Hat
dilla...@redhat.com
http://www.redhat.com
- Original Message -
From: Xu (Simon) Chen xche...@gmail.com
To: ceph-users@lists.ceph.com
Sent: Wednesday, February 25, 2015 7:12:01 PM
Subject: [ceph-users] Question regarding rbd cache
Hi folks,
I am curious about how RBD cache works, whether it caches and writes back
entire objects. For example, if my VM images are stored with order 23 (8MB
blocks), would a 64MB rbd cache only be able to cache 8 objects at a time? Or
does it work at a more granular fashion? Also, when a sync/flush happens, would
the entire 8MB block be written back to ceph, or maybe some offset writes
happens?
Thanks.
-Simon
___
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
___
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com