在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:KeyDB开源软件地址:https://gitee.com/mirrors/KeyDB开源软件介绍:What is KeyDB?KeyDB is a high performance fork of Redis focussing on multithreading, memory efficiency, and high throughput. In addition to multithreading KeyDB also has features only available in Redis Enterprise such as FLASH storage support, and some not available at all such as direct backup to AWS S3. On the same hardware KeyDB can perform twice as many queries per second as Redis, with 60% lower latency. Why fork Redis?The Redis maintainers have continually reiterated that they do not plan to support multithreading. While we have great respect for the redis team, we feel the analysis justifying this decision is incorrect. In addition we wanted open source implementations of features currently only available in proprietary modules. We feel a fork is the best way to accelerate development in the areas of most interest to us. We plan to track the Redis repo closely and hope our projects can learn from each other. Benchmarking KeyDBPlease note keydb-benchmark and redis-benchmark are currently single threaded and too slow to properly benchmark KeyDB. We recommend using a redis cluster benchmark tool such as memtier. Please ensure your machine has enough cores for both KeyDB and memteir if testing locally. KeyDB expects exclusive use of any cores assigned to it. For more details on how we benchmarked KeyDB along with performance numbers check out our blog post: Redis Should Be Multithreaded New Configuration OptionsWith new features comes new options: server-threads N The number of threads used to serve requests. This should be related to the number of queues available in your network hardware, not the number of cores on your machine. Because KeyDB uses spinlocks to reduce latency; making this too high will reduce performance. We recommend using 4 here. By default this is set to one. scratch-file-path /path If you would like to use the FLASH backed storage this option configures the directory for KeyDB's temporary files. This feature relies on snapshotting to work so must be used on a BTRFS filesystem. ZFS may also work but is untested. With this feature KeyDB will use RAM as a cache and page to disk as necessary. NOTE: This requires special compilation options, see Building KeyDB below. db-s3-object /path/to/bucket If you would like KeyDB to dump directly to AWS S3 this option specifies the bucket. Using this option with the traditional RDB options will result in KeyDB backing up twice to both locations. This requires the AWS CLI tools to be installed and configured which are used under the hood to transfer the data. All other configuration options behave as you'd expect. Your existing configuration files should continue to work unchanged. Building KeyDBKeyDB can be compiled and is tested for use on Linux. KeyDB currently relies on SO_REUSEADDR's load balancing behavior which is available only in Linux. When we support marshalling connections across threads we plan to support other operating systems such as FreeBSD. Compiling is as simple as: % make You can enable flash support with (Note: autoconf and autotools must be installed): % make MALLOC=memkind Fixing build problems with dependencies or cached build optionsKeyDB has some dependencies which are included into the When you update the source code with make distclean This will clean: jemalloc, lua, hiredis, linenoise. Also if you force certain build options like 32bit target, no C compileroptimizations (for debugging purposes), and other similar build time options,those options are cached indefinitely until you issue a Fixing problems building 32 bit binariesIf after building KeyDB with a 32 bit target you need to rebuild itwith a 64 bit target, or the other way around, you need to perform a In case of build errors when trying to build a 32 bit binary of KeyDB, trythe following steps:
AllocatorSelecting a non-default memory allocator when building KeyDB is done by settingthe To force compiling against libc malloc, use: % make MALLOC=libc To compile against jemalloc on Mac OS X systems, use: % make MALLOC=jemalloc Verbose buildKeyDB will build with a user friendly colorized output by default.If you want to see a more verbose output use the following: % make V=1 Running KeyDBTo run KeyDB with the default configuration just type: % cd src% ./keydb-server If you want to provide your keydb.conf, you have to run it using an additionalparameter (the path of the configuration file): % cd src% ./keydb-server /path/to/keydb.conf It is possible to alter the KeyDB configuration by passing parameters directlyas options using the command line. Examples: % ./keydb-server --port 9999 --replicaof 127.0.0.1 6379% ./keydb-server /etc/keydb/6379.conf --loglevel debug All the options in keydb.conf are also supported as options using the commandline, with exactly the same name. Playing with KeyDBYou can use keydb-cli to play with KeyDB. Start a keydb-server instance,then in another terminal try the following: % cd src% ./keydb-clikeydb> pingPONGkeydb> set foo barOKkeydb> get foo"bar"keydb> incr mycounter(integer) 1keydb> incr mycounter(integer) 2keydb> You can find the list of all the available commands at http://redis.io/commands. Installing KeyDBIn order to install KeyDB binaries into /usr/local/bin just use: % make install You can use Make install will just install binaries in your system, but will not configureinit scripts and configuration files in the appropriate place. This is notneeded if you want just to play a bit with KeyDB, but if you are installingit the proper way for a production system, we have a script doing thisfor Ubuntu and Debian systems: % cd utils% ./install_server.sh The script will ask you a few questions and will setup everything you needto run KeyDB properly as a background daemon that will start again onsystem reboots. You'll be able to stop and start KeyDB using the script named Code contributionsNote: by contributing code to the KeyDB project in any form, including sendinga pull request via Github, a code fragment or patch via private email orpublic discussion groups, you agree to release your code under the termsof the BSD license that you can find in the COPYING file included in the KeyDBsource distribution. Please see the CONTRIBUTING file in this source distribution for moreinformation. |
请发表评论