Configuring a cache tier

A cache tier has several configuration options that define the cache tier policy. This cache tier policy is required to flush data from the cache tier to the storage tier in case of a writeback. In the case of the read-only cache tier, it moves the data from the storage tier to the cache tier. In this recipe, I have tried to demonstrate the cache tier with the writeback mode. These are some settings that you should configure for your production environment, with different values based on your requirements:

How to do it…

  1. For production deployment, you should use the 'bloom filters' data structure:
    # ceph osd pool set cache-pool hit_set_type bloom
    
  2. hit_set_count defines how much time in seconds each hit set should cover, and hit_set_period defines how many such hit sets are to be persisted:
    # ceph osd pool set cache-pool hit_set_count 1
    # ceph osd pool set cache-pool hit_set_period 300
    
  3. target_max_bytes is the maximum number of bytes after the cache-tiering agent starts flushing/evicting objects from a cache pool. Whereas target_max_objects is the maximum number of objects after which a cache-tiering agent starts flushing/evicting objects from a cache pool:
    # ceph osd pool set cache-pool target_max_bytes 1000000
    # ceph osd pool set cache-pool target_max_objects 10000
    
    How to do it…
  4. Enable cache_min_flush_age and cache_min_evict_age, which are the times in seconds that a cache-tiering agent takes to flush and evict objects from a cache tier to a storage tier:
    # ceph osd pool set cache-pool cache_min_flush_age 300
    # ceph osd pool set cache-pool cache_min_evict_age 300
    
    How to do it…
  5. Enable cache_target_dirty_ratio, which is the percentage of the cache pool containing dirty (modified) objects before the cache-tiering agent flushes them to the storage tier:
    # ceph osd pool set cache-pool cache_target_dirty_ratio .01
    
  6. Enable cache_target_full_ratio, which is the percentage of the cache pool containing unmodified objects before the cache-tiering agent flushes them to the storage tier:
    # ceph osd pool set cache-pool cache_target_full_ratio .02
    

    Once you have completed these steps, the Ceph cache tiering setup should complete, and you can start adding workload to it:

  7. Create a temporary file of 500 MB that we will use to write to the EC-pool, and which will eventually be written to a cache-pool:
    # dd if=/dev/zero of=/tmp/file1 bs=1M count=500
    
    How to do it…
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.189.67