Not the answer you need?
Register and ask your own question!
Many Forum changes were implemented on Tue 22 Sep. Read about new Ranks, Scoring, and Reactions.
Email [email protected] for any comments or concerns.

questions about Facebook's Flashcache

seagenseagen ContributorInactive User Role Beginner
Recently learning Facebook's Flashcache, I have some questions on it as follow:

1. to use random write or sequential write on Flashcache?

2. why writeback is persistent, but writethrough is non-persistent?

3. when writing into Flashcache, if cache miss occurs how will it deal with? I mean that is firstly reading original blocks from disk into Flashcache and then writing flashcache, OR directly writing into cache.



Regards,
Zhang

Comments

  • ovais.tariqovais.tariq Entrant Inactive User Role Beginner
    Hi,

    So flashcache module is a Kernel module that allows to use a SSD as a caching device that caches IO requests. You can think of it as similar to the cache present on a RAID controller.

    Now let me answer your questions.

    1. to use random write or sequential write on Flashcache?
    SSDs give best performance for random IO operations while the HDDs give best performance for sequential IO operations. Hence, its best to let SSD handle all the random IO and let the rotating disks handle the sequential IO. This can be configured when flashcache is configured to run in writeback mode by tuning the sysctl parameter "skip_seq_thresh_kb", this can be done as follows:
    dev.flashcache.sdb+c0d2.skip_seq_thresh_kb = 1024

    Here "sdb+c0d2" is the name of the flashcache device. By setting skip_seq_thresh_kb to 1024 we are instructing the flashcache module to let IO operations greater than 1MB to pass through to the HDDs.

    2. why writeback is persistent, but writethrough is non-persistent?
    In writeback mode the writes are first performed on the SSD and then written back to the HDDs at a later time. In writethrough mode all writes are performed on the SSDs and immediately performed on the HDDs as well, which means that all the data that is present on the SSDs is also present on the HDDs and hence there is no need to maintain persistence

    3. when writing into Flashcache, if cache miss occurs how will it deal with? I mean that is firstly reading original blocks from disk into Flashcache and then writing flashcache, OR directly writing into cache.
    As in all caching mechanisms, upon a cache miss, the ata block is read from the disk and written to the SSD and then modified on the SSD afterwards what happens depends on the cache policy being used. If the cache policy is writeback, then the write is not immediately performed on the disk, however if the cache policy is writethrough then the write is immediately performed on the disk as well.
  • seagenseagen Contributor Inactive User Role Beginner
    Thanks so much,Ovais, for your nice words. Right now I was clear. And later I will read through flashcache-sa-guide carefully. (p.s.: have you heard Techlogix in Pakistan? I had ever worked for it.So I am so missing my Pakistan colleagues.)
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.