For these tests I used the ssd-test example jobfile and modified the size parameter to 8G. The Flexible IO tester is much better to benchmark these situations. In the File metadata tests the performance improves when using bcache. Bonnie++ isn’t able to warm up the cache and all sequential writes are bypassing the write cache. The bcache test doesn’t show much difference to the HDD-only test in this case. This graph shows that I’m hitting the limit on sequential input and output in the HDD-only and SSD-only tests. Unfortunately Bonnie++ isn’t that well suited to test SSD caching setups. To benchmark this setup I used two different tools. Stop the backing device (after unmounting /dev/bcache0 it will be stopped and removed, don’t forget to unregister the caching device): echo 1 > /sys/block/sda/sda/bcache/stop Benchmark Register the caching device again (or register another caching device): echo /dev/sdb > /sys/fs/bcache/registerĪttach the caching device: echo > /sys/block/sda/sda/bcache/attach Unregister the caching device (can be done with or without detaching) (/dev/bcache0 will still be available because of the backing device): echo 1 > /sys/fs/bcache//unregister echo 1 > /sys/block/sda/sda/bcache/detachĪttach the caching device again (or attach another caching device): echo > /sys/block/sda/sda/bcache/attach This can take a while when the write cache contains dirty data, because it must be written to the backing device first. To detach the caching device from the backing device run the command below (/dev/bcache0 will still be available). You can check the state of the writeback cache via: cat /sys/block/sda/sda/bcache/state The cache is clean again, when all cached writes have been written to the backing device. When writes are cached on the caching device, the cache is called dirty. echo writeback > /sys/block/sda/sda/bcache/cache_mode But there is a chance you will end up with corruption. In case of a power failure bcache will try to recover the data. Bcache uses a fairly simple journalling mechanism on the caching device. For example when there is a power failure or when the SSD dies. But you have to take in mind, there is a risk of losing data when using a writeback cache. To speed up the writes you have to enable writeback caching. Writes are being written directly to the backing device (HDD). By default bcache uses writethrough caching, which means that only reads are cached. Accessing and reading frequently used files is much faster now. Frequently used data is stored on the SSD. The commands for this procedure are shown in the image below.Īfter this I had a working SSD caching setup. For example when booting, bcache needs to know what devices to attach to each other.
ROMEX FANCYCACHE SOFTWARE
The creation of a caching and backing device is necessary because it’s a software implementation. This device can be formatted with your favourite filesystem. Those devices can be attached to each other to create a /dev/bcache0 device. First you have to create a caching device (SSD) and a backing device (HDD) on top of two existing devices. You can’t use bcache with an existing formatted partition. Unfortunately bcache isn’t plug-and-play. Fortunately damoxc already packaged bcache-tools for Ubuntu once.ĭebian package: /…/bcache/ Since there is no bcache-tools Debian package available yet, I created my own. On my low power home server I use Debian. Don’t forget to enable the BCACHE module before compiling. The bcache-3.2 branch from Kent’s git repo merged successfully.
ROMEX FANCYCACHE PATCH
The last one is interesting, because it’s a patch on top of the Linux kernel and will hopefully be accepted upstream some day. There is Flashcache developed by Facebook, dm-cache by VISA and bcache by Kent Overstreet. Fanc圜ache by Romex Software (Windows, software)īut there is also a lot of development on the Linux front.Read圜ache by SanDisk (Windows, software, Writethrough).Dataplex by Nvelo (Windows, software, Write-back).Smart Response Technology (SRT) by Intel (hardware solution, Write-back).A couple of manufacturers are selling solutions to speed up your big HDD using a relative small SSD.