{"id":18886395,"url":"https://github.com/pmem/pmem-redis","last_synced_at":"2025-04-14T21:31:07.652Z","repository":{"id":51098333,"uuid":"149540248","full_name":"pmem/pmem-redis","owner":"pmem","description":"A version of Redis that uses persistent memory","archived":false,"fork":false,"pushed_at":"2021-07-28T00:56:46.000Z","size":5936,"stargazers_count":112,"open_issues_count":9,"forks_count":47,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-04-28T02:42:33.029Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-20T02:33:35.000Z","updated_at":"2024-03-01T03:21:28.000Z","dependencies_parsed_at":"2022-08-30T00:21:09.811Z","dependency_job_id":null,"html_url":"https://github.com/pmem/pmem-redis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmem%2Fpmem-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmem%2Fpmem-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmem%2Fpmem-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmem%2Fpmem-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmem","download_url":"https://codeload.github.com/pmem/pmem-redis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223647068,"owners_count":17179206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T07:27:13.489Z","updated_at":"2024-11-08T07:27:14.125Z","avatar_url":"https://github.com/pmem.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PROJECT NOT UNDER ACTIVE MANAGEMENT #  \nThis project will no longer be maintained by Intel.  \nIntel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.  \nIntel no longer accepts patches to this project.  \n If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the open source software community, please create your own fork of this project.  \n  \nBadge | Status\n--- | ---\n**Current Version** | [![Current Version](https://img.shields.io/badge/Release-V1.0--RC1-brightgreen.svg)](https://github.com/pmem/pmem-redis)\n\n# What is Redis?\n\nRedis is often referred as a *data structures* server. What this means is that Redis provides access to mutable data structures via a set of commands, which are sent using a *server-client* model with TCP sockets and a simple protocol. So different processes can query and modify the same data structures in a shared way.\n\nData structures implemented into Redis have a few special properties:\n\n* Redis cares to store them on disk, even if they are always served and modified into the server memory. This means that Redis is fast, but that is also non-volatile.\n* Implementation of data structures stress on memory efficiency, so data structures inside Redis will likely use less memory compared to the same data structure modeled using an high level programming language.\n* Redis offers a number of features that are natural to find in a database, like replication, tunable levels of durability, cluster, high availability.\n\nAnother good example is to think of Redis as a more complex version of memcached, where the operations are not just SETs and GETs, but operations to work with complex data types like Lists, Sets, ordered data structures, and so forth.\n\nIf you want to know more, this is a list of selected starting points:\n\n* Introduction to Redis data types. http://redis.io/topics/data-types-intro\n* Try Redis directly inside your browser. http://try.redis.io\n* The full list of Redis commands. http://redis.io/commands\n* There is much more inside the Redis official documentation. http://redis.io/documentation\n\n# What is Pmem-Redis?\n\n[Pmem-Redis](https://github.com/pmem/pmem-redis) is one redis version that support **Intel DCPMM(Data Center Persistent Memory)** based on open source [redis-4.0.0](https://github.com/antirez/redis/tree/4.0). It benefits the redis's performance by taking advantage of DCPMM competitive performance and persistency.  \n\nBasically Pmem-Redis covers many aspects that related to DCPMM usage: \n* Five typical data structures optimization including: String, List, Hash, Set, Zset.\n* DCPMM copy-on-write\n* Redis LRU for DCPMM\n* Redis defragmentation support for DCPMM\n* Pointer-based redis AOF\n* Persistent ring buffer\n\n# Get code\n\n1. clone the code:\n```\ngit clone https://github.com/pmem/pmem-redis\n```\n2. PMDK is one submodule of this repo, so you have to init this submodule in order to get code\n```\ngit submodule init\ngit submodule update\n```\n\n# Building Pmem-Redis\n## Compile Options\n Switches | Value | Descriptions\n-- | -- | --\nUSE_NVM | yes/no | DCPMM enable Switch. W/O this option, will compile opensource redis that does not support DCPMM.\nAEP_COW | yes/no | DCPMM Copy-On-Write Switch. W/O this option, the BG save and replication will not support\nSUPPORT_PBA | yes/no | Pointer Based Aof support Switch. W/O this option, PBA is not support, Same AOF mechanism with open source redis.\nUSE_AOFGUARD | yes/no | Write Turbo with DCPMM option switch. W/O this option, the AOF log write to the SSD by the page cache directly.\n \n## How to compile\n**Prerequisite**\n* Install `autoconf`, `automake`, `libtool`, `numactl-devel` and `tcl` on system\n\nIf you want to build the Pmem-Redis for DCPMM, please install following packages as well:\n`libndctl-dev`, `libdaxctl-dev` and `libnuma-dev`\n\n**Compile example**:\n\nIf you want to build the original opensource redis-4.0.0, run command:\n\n    make\n\nIf you want to build the Pmem-Redis for DCPMM, run command:\n\n    make USE_NVM=yes\n\nIf you need enable `AEP_COW`, `SUPPORT_PBA` or `USE_AOFGUARD`, you need to enable `USE_NVM` compile option.\n\n# Fixing build problems with dependencies or cached build options\n\nPmem-Redis has some dependencies which are included into the `deps` directory.\n`make` does not automatically rebuild dependencies even if something in\nthe source code of dependencies changes.\n\nWhen you update the source code with `git pull` or when code inside the\ndependencies tree is modified in any other way, make sure to use the following\ncommand in order to really clean everything and rebuild from scratch:\n\n    make distclean\n\nThis will clean: jemalloc, lua, hiredis, linenoise, pmdk, memkind, jemallocat, aofguard.\n\nAlso if you force certain build options like 32bit target, no C compiler\noptimizations (for debugging purposes), and other similar build time options,\nthose options are cached indefinitely until you issue a `make distclean`\ncommand.\n\n# Running Pmem-Redis\n## New supported server command:\n \n server command | argument | describe\n---- | ---- | ----\n --nvm-maxcapacity | Integer (G) | Set the maximum DCPMM capacity of the redis instance\n--nvm-dir | Like: /mnt/pmem0 | Path of DCPMM DAX file system\n--nvm-threshold | Integer (default 64) | Threshold of value size, if  greater than  threshold, the value   may be stored on the DCPMM\n--pointer-based-aof | yes/no | Enable or disable pointer based AOF\n--use-aofguard | yes/no | Enable or disable persistent ring buffer \n\n## Prepare nvm device for redis to run\n\nCreate namespace:\n\n    ndctl create-namespace -m fsdax -r \u003cregionid\u003e\n    \nThen you may see `/dev/pmem\u003cid\u003e` under `/dev` folder, for example, we have `/dev/pmem0` in our machine.\n\nFormat the pmem device:\n\n    mkfs.ext4 /dev/pmem0\n    \nMount as dax:\n    \n    mkdir /mnt/pmem0\n    mount -o dax /dev/pmem0 /mnt/pmem0\n    \n## Run pmem-redis:\n\n    src/redis-server --nvm-maxcapacity 1 --nvm-dir /mnt/pmem0 --nvm-threshold 64\n\nThis command starts a redis server that uses DCPMM device(/mnt/pmem0) with max capacity 1GB, and it moves the values whose length are greater than 64 into DCPMM.\n \n# Hints \n1. In our Unit Test, we default read `/mnt/pmem0` as pmem device and run test, please modify your pmem device folder to `/mnt/pmem0` to meet the requirement.\n\n2. If you enable --pointer-based-aof in redis server, than pmem-redis will generate one `.ag` file under `/mnt/pmem0` device which link to the AOF file generated on disk. If you need to delete the AOF file, please make sure to delete the `.ag` file at the same time to avoid AOF load error.\n\n# Code contributions\n\n1. Please fork this repositry to your github account and start deveopment, please refer to redis code style\n2. Pull requests let you tell others about changes you've pushed to a repository on GitHub. \n3. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before the changes are merged into the repository.\n\nNote: When working with pull requests, keep the following in mind:\n\nIf you're working in the shared repository model, we recommend that you use a topic branch for your pull request. While you can send pull requests from any branch or commit, with a topic branch you can push follow-up commits if you need to update your proposed changes.\nWhen pushing commits to a pull request, don't force push. Force pushing can corrupt your pull request.\nAfter initializing a pull request, you'll see a review page that shows a high-level overview of the changes between your branch (the compare branch) and the repository's base branch. You can add a summary of the proposed changes, review the changes made by commits, add labels, milestones, and assignees, and @mention individual contributors or teams. For more information, see \"Creating a pull request.\"\n![pull request page](https://help.github.com/assets/images/help/pull_requests/pull-request-review-page.png)\n\nOnce you've created a pull request, you can push commits from your topic branch to add them to your existing pull request. These commits will appear in chronological order within your pull request and the changes will be visible in the \"Files changed\" tab.\n\nOther contributors can review your proposed changes, add review comments, contribute to the pull request discussion, and even add commits to the pull request.\n\nEnjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmem%2Fpmem-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmem%2Fpmem-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmem%2Fpmem-redis/lists"}