Skip to contentSkip to conversation

comparison with rival projects

DISCUSSION [email protected] 2 participants 2 messages Dec 16, 2010 1 message not in the archive bcache (block layer cache)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 824216649.28481292460292573.JavaMail.root@shiva

#1 lore raw

First of all, I would like to thanks for answers.

One more question and some reply in text.

After making ssd disc a cache for some partition, there is possibility to detach cache. What should I do to "erase" (trim) whole disk for another benchmarking? I think that "dd if=/dev/zero of=/dev/sdx" wouldnt be right command.

Quoted 76 lines · ----- "Nauman Rafique
Quoted 4 lines · Kent Overstreet
Quoted 3 lines · On 12/15/2010 03:26 PM, [email protected] wrote:

Hi,
Iam new in problematic of caching persistent data. I want to use

caching

Quoted 1 line
Quoted 1 line

(on ssd disk) on my desktop with a lot of ram. I hope, it will

provide me

Quoted 1 line
Quoted 1 line

better latency for starting programs (developer/scientific

desktop). My

Quoted 3 lines
Quoted 3 lines

questions are:

Is it possible to use single ssd disk for making two caches? One

for

Quoted 1 line
Quoted 1 line

/dev/md2 (root partition, raid10) and second for /dev/md3

(raid5,home

Quoted 1 line
Quoted 1 line

partition, etc) (I hope this is possible by partitioning that ssd

disk and

Quoted 3 lines
Quoted 1 line

using partitions for caching)

Yep. One cache device can be used with (currently) up to 256

backing

Quoted 4 lines

devices.

Quoted 2 lines

Is it dangerous (in terms of data loss) to use writethrough caching

to

Quoted 1 line
Quoted 1 line

single ssd disk of raid5 block device? (I have 5 disks, using lvm

on top of

Quoted 3 lines
Quoted 1 line

raid).

Shouldn't be, recovery from unclean shutdown is quite well tested,

both

Quoted 4 lines

writethrough and writeback should be perfectly safe.

Quoted 2 lines

For caching device is most critical number for random reads or

operations

Quoted 3 lines
Quoted 1 line

per second. Is it right?

For writethrough caching random reads, for writeback both reads and

writes.

Quoted 3 lines
Quoted 3 lines

Trim is not need feature for cache ssd device. It will have same

cache

Quoted 3 lines
Quoted 1 line

performance without it. Is it right?

Really just depends on the ssd; some (cheaper, earlier) drives are

known for

Quoted 1 line

performance significantly degrading over time, with trim helps with

(but

Quoted 4 lines

doesn't necessarily eliminate). Bcache uses trim if it's available.

Quoted 2 lines

What benefits/disadvantages have bcache [1] project over dm-cache

[2] and

Quoted 1 line
Quoted 1 line

flashcache [3]? My current knowledge is that writethrough is

possible only

Quoted 1 line
Quoted 1 line

in bcache, but dm-cache is implemented in more "standard" way

(thdough

Quoted 9 lines
Quoted 5 lines

devicemaper). Also bcache has some more information on web.

[1] - http://bcache.evilpiepirate.org/
[2] - http://users.cis.fiu.edu/~zhaom/dmcache/index.html
[3] - https://github.com/facebook/flashcache

Flashcache is based off of dm-cache.

Flashcache has been used in production awhile, bcache is still a

little

Quoted 1 line

rough around the edges - but bcache has better performance, more

features,

Quoted 1 line

and it always orders writes correctly so as to be crash safe

(flashcache has

Quoted 8 lines
Quoted 1 line

a "torn write" problem).

Kent, now that we are on the topic, I wonder if there has been some benchmarking comparing bcache to flashcache performance?

Also I wonder if you plan to target for getting bcache included in mainline kernel. I wonder if such attempts were made for flashcache but that's probably off-topic.

I hope, next two links will help in making comparison.
http://www.mysqlperformanceblog.com/2010/05/10/flashcache-first-experiments/
http://www.mysqlperformanceblog.com/2010/05/18/flashcache-more-benchmarks/
There is simple methodology of cache testing by using it with mysql database. I hope, someone will catch this discussion and try some comparable test on bcache.

For me will be next test sufficient:
Activate caching and make for example 20 reboots. Measure time from computer bios beep till starting gimp, which will be in gnome/kde/fluxbox autostart script. Of course before starting gimp, there will be need for starting some other programs like firefox, eclipse, mplayer with some film...

I would like to see these times of booting in graph. I promise that after installation of bcache I will do this test with bcache and post it here.

Quoted 21 lines

Thanks.
--
Nauman

Quoted 5 lines
Quoted 3 lines

PS: Is there any tutorial for gentoo users?

Nah, I'm an ubuntu/debian user. For caching / the important thing is

to hook

Quoted 1 line

into your initramfs and get everything loaded before you mount your

root

Quoted 8 lines

filesystem.

Quoted 6 lines

Thanks for any explanations / answers,
--
LuVar
--
To unsubscribe from this list: send the line "unsubscribe

Quoted 10 lines

linux-bcache" in

Quoted 5 lines
Quoted 2 lines

the body of a message to [email protected] More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe

linux-bcache" in

Quoted 3 lines

the body of a message to [email protected] More majordomo info at  http://vger.kernel.org/majordomo-info.html

PS: I am now decided to use bcache (after buying some ssd).
--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 5 lines · On 12/15/2010 04:46 PM, [email protected] wrote:

First of all, I would like to thanks for answers.

One more question and some reply in text.

After making ssd disc a cache for some partition, there is possibility to detach cache. What should I do to "erase" (trim) whole disk for another benchmarking? I think that "dd if=/dev/zero of=/dev/sdx" wouldnt be right command.

Yeah, one nifty thing is you can disable caching on a mounted, in use filesystem (and reenable it provided you invalidate the cache somehow).

Hdparm can send a trim, but it can't do the whole disk at once, you've got to script it. I wrote one awhile back, this is what I use:

#!/bin/bash

DEV=$1

if [ ! -b "$DEV" ]; then
echo "Can't open $DEV"
exit 1
fi

SECTORS=hdparm -I "$DEV"|awk '/LBA48/ { print $5 }' OFFSET=0

echo "$DEV has $SECTORS sectors:"

while (($SECTORS)); do

        i=$(( $SECTORS > 65535 ? 65535 : $SECTORS ))

        echo "wiping $i sectors at offset $OFFSET"
        hdparm --please-destroy-my-drive \
		--trim-sector-ranges $OFFSET:$i $DEV

        SECTORS=$(($SECTORS - $i))
        OFFSET=$(($OFFSET + $i))

done
--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html