mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-03-14 10:01:52 +00:00
This function analyzes the compressability of the keys using a single huffman tree. For example, ``` >debug POPULATE 1000000 keyabcdef 10 OK > debug compression 1) max_symbol 2) (integer) 121 3) max_bits 4) (integer) 5 5) raw_size 6) (integer) 7861817 7) compressed_size 8) (integer) 4372270 9) ratio 10) "0.5561398847111297" ``` Signed-off-by: Roman Gershman <roman@dragonflydb.io>
1.9 KiB
1.9 KiB
Build DragonflyDB From Source
Running the server
Dragonfly runs on linux. We advise running it on linux version 5.11 or later but you can also run Dragonfly on older kernels as well.
⚠️ Dragonfly releases are compiled with LTO (link time optimization): Depending on the workload this can notably improve performance. If you want to benchmark Dragonfly or use it in production, you should enable LTO by giving
blaze.sh
the-DCMAKE_CXX_FLAGS="-flto"
argument.
Step 1 - install dependencies
On Debian/Ubuntu:
sudo apt install ninja-build libunwind-dev libboost-context-dev libssl-dev \
autoconf-archive libtool cmake g++ bison zlib1g-dev
On Fedora:
sudo dnf install -y automake boost-devel g++ git cmake libtool ninja-build \
openssl-devel libunwind-devel autoconf-archive patch bison libstdc++-static
On openSUSE:
sudo zypper install automake boost-devel gcc-c++ git cmake libtool ninja \
openssl-devel libunwind-devel autoconf-archive patch bison \
libboost_context-devel libboost_system-devel
On FreeBSD:
pkg install -y git bash cmake ninja libunwind boost-libs autoconf automake libtool gmake bison
Step 2 - clone the project
git clone --recursive https://github.com/dragonflydb/dragonfly && cd dragonfly
Step 3 - configure & build it
# Configure the build
./helio/blaze.sh -release
# Build
cd build-opt && ninja dragonfly
Step 4 - voilà
# Run
./dragonfly --alsologtostderr
Dragonfly DB will answer to both http
and redis
requests out of the box!
You can use redis-cli
to connect to localhost:6379
or open a browser and visit http://localhost:6379
Step 5
Connect with a redis client
redis-cli
127.0.0.1:6379> set hello world
OK
127.0.0.1:6379> keys *
1) "hello"
127.0.0.1:6379> get hello
"world"
127.0.0.1:6379>
Step 6
Continue being great and build your app with the power of DragonflyDB!