Skip to main content

NCRedis: An NVM-Optimized Redis with Memory Caching

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNISA,volume 12924))

Abstract

Non-volatile memory (NVM) has byte-addressability and data-durability. Redis, a popular in-memory kv-store system, can persist data when replacing DRAM with NVM. However, to implement NVM Redis, we need to use general NVM allocators to obtain NVM and guarantee the data consistency of Redis. There are two problems in NVM Redis. First, it is expensive to directly use NVM allocators with numerous metadata modification and logging. Second, logging which is also used to guarantee the data consistency of NVM Redis leads to write amplification and degrades the run-time performance of Redis. In this paper, we find that these two problems can be solved by exploiting memory caching inside Redis under NVM. Firstly, memory caching like the well-known Linux Slab will cache freed memory, reducing expensive NVM allocation/deallocation. Secondly, by recording all allocated NVM, caching can handle the persistent memory leak of Redis, which is the only inconsistent state induced by failures. Thus, the use of logging in NVM Redis can be avoided by using memory caching. In this paper, we propose an NVM caching called LFSlab (Log-Free Slab), while the conventional Slab needs logging to guarantee its consistency under NVM. Using LFSlab, we propose NCRedis (NVM Caching Redis) under NVM. In the experiment with Optane persistent memory, Redis with LFSlab outperforms the naive implementation of NVM Redis with no caching by 1.52-2.65x and DRAM Redis with data backup in disks by 1.27x, and gets at least 94% performance of DRAM-only Redis, while Optane persistent memory is 2-3x slower than DRAM at a 39% cost savings.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    https://www.intel.com/content/www/us/en/arch-itecture-and-technology/optane-dc-persistent-memory.html.

References

  1. Bhandari, K., Chakrabarti, D.R., Boehm, H.J.: Makalu: fast recoverable allocation of non-volatile memory. ACM SIGPLAN Not. 51(10), 677–694 (2016)

    Article  Google Scholar 

  2. Bonwick, J., et al.: The slab allocator: An object-caching kernel memory allocator. In: USENIX Summer, vol. 16. Boston (1994)

    Google Scholar 

  3. Cai, W., Wen, H., Beadle, H.A., Kjellqvist, C., Hedayati, M., Scott, M.L.: Understanding and optimizing persistent memory allocation. In: Proceedings of the 2020 ACM SIGPLAN International Symposium on Memory Management, pp. 60–73 (2020)

    Google Scholar 

  4. Carlson, J.: Redis in Action. Simon and Schuster, New York (2013)

    Google Scholar 

  5. Liu, J., Chen, S., Wang, L.: Lb+ Trees: optimizing persistent index performance on 3dxpoint memory. Proc. VLDB Endow. 13(7), 1078–1090 (2020)

    Article  Google Scholar 

  6. Oukid, I., Lasperas, J., Nica, A., Willhalm, T., Lehner, W.: FPTree: a hybrid SCM-DRAM persistent and concurrent b-tree for storage class memory. In: Proceedings of the 2016 International Conference on Management of Data, pp. 371–386 (2016)

    Google Scholar 

  7. Scargall, S.: Programming Persistent Memory: A Comprehensive Guide for Developers (2020)

    Google Scholar 

  8. Schwalb, D., Berning, T., Faust, M., Dreseler, M., Plattner, H.: nvm malloc: memory allocation for NVRAM. ADMS@VLDB 15, 61–72 (2015)

    Google Scholar 

Download references

Acknowledgements

We thank NetEase for providing the machine with Optane persistent memory. The corresponding author of this work is Jianlin Feng. This work is partially supported by China NSFC under Grant No. 61772563.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jianlin Feng .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Zhang, J., Yao, Z., Feng, J. (2021). NCRedis: An NVM-Optimized Redis with Memory Caching. In: Strauss, C., Kotsis, G., Tjoa, A.M., Khalil, I. (eds) Database and Expert Systems Applications. DEXA 2021. Lecture Notes in Computer Science(), vol 12924. Springer, Cham. https://doi.org/10.1007/978-3-030-86475-0_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-86475-0_7

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-86474-3

  • Online ISBN: 978-3-030-86475-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics