- CMake
- Anaconda3
- Python packages:
pip install python-memcached fabric
- Other dependencies:
sudo apt install libmemcached-dev memcached libboost-all-dev libhiredis-dev
- Redis++:
git clone https://github.com/sewenew/redis-plus-plus.git cd redis-plus-plus mkdir build cd build cmake .. make -j 8 sudo make install
- Modify
/etc/memcached.conf
-l 0.0.0.0 -I 128m -m 2048
We provide a script for downloading Twitter workloads in workloads/download_workloads.sh
. Execute cd workloads && ./download_workloads.sh twitter
to download and setup the execution directories for the Twitter workloads. You may at leat 1TB disk space to download and decompress these workloads.
We support executing client threads on multiple nodes. Different nodes are synchronized through memcached with a controller. We currently support two modes of executions:
- Separate data loading and workload execution
- Load data:
python3 scripts/ycsb_load_or_trans.py <memcached-ip> <num-clients>
. The<num-clients>
field should be the total number of client threads.- On another client node:
cd build && ./redis_load_ycsb <node-id> <num-local-threads> <num-total-threads> <memcached-ip> load <redis-ip> <execution-time> <output-fname> <mode>
. Theload
and<execution-time>
are a placeholders, taking no effect to the command. The<mode>
field can either becluster
,single
, ordmc_cluster
. Note that this program will automatically read the workload file in../workloads/ycsb
, hence must be executed in thebuild
directory. An output will be written tobuild/results
as a json file.
- Executing workload normally:
python3 scripts/ycsb_load_or_trans.py <memcached-ip> <num-clients>
- On another client node:
cd build && ./redis_trans_ycsb <node-id> <num-local-threads> <num-total-threads> <memcached-ip> <workload> <redis-ip> <execution-time> <output-fname> <mode> normal
. The<workload>
should be in[ycsba, ycsbb, ycsbc, ycsbd, twitter-compute, twitter-storage, twitter-transient]
and The<execution-time>
controls how long each thread iterates with the workload. The<mode>
field can either becluster
,single
, ordmc_cluster
. Note that this program will automatically read the workload file in../workloads/ycsb
, hence must be executed in thebuild
directory. An output will be written tobuild/results
as a json file.
- Executing workload for dmc cluster:
0. Prepare experiment settings:
- In
scripts/ycsb_dmc_cluster_elasticity.py
there are two variables to control the execution time of scale out and scale in nodes, which areseconds_before_scale
andseconds_before_shrink
. - Indmc_cluster_config.json
setnum_initial_servers
andnum_scale_servers
to control the number of servers used before and after resource scaling.python scripts/ycsb_dmc_cluster_elasticity.py <memcached-ip> <num-clients>
.- On another client node:
cd build && ./redis_trans_ycsb <node-id> <num-local-threads> <num-total-threads> <memcached-ip> <workload> <redis-ip> <execution-time> <output-fname> <mode> elasticity
. The<workload>
should be in[ycsba, ycsbb, ycsbc, ycsbd, twitter-compute, twitter-storage, twitter-transient]
and The<execution-time>
controls how long each thread iterates with the workload. The<mode>
field can either becluster
,single
, ordmc_cluster
. Note that this program will automatically read the workload file in../workloads/ycsb
, hence must be executed in thebuild
directory. An output will be written tobuild/results
as a json file.
- Load data:
- End-to-end testing (load data and execute the workload):
python3 scripts/ycsb_load_and_trans.py <memcached-ip> <num-clients>
. The<num-clients>
field should be the total number of client threads.- On another client node:
cd build && ./redis_perf <node-id> <num-local-threads> <num-total-threads> <memcached-ip> <workload> <redis-ip> <execution-time> <output-fname> <mode> <experiment>
. The<workload>
should be in[ycsba, ycsbb, ycsbc, ycsbd]
and The<execution-time>
controls how long each thread iterates with the workload. The<mode>
field can either becluster
,single
,dmc_cluster
,sentinel
, ordmc_sentinel
. Note that this program will automatically read the workload file in../workloads/ycsb
, hence must be executed in thebuild
directory. An output will be written tobuild/results
as a json file. The<experiment>
field can either benormal
,elasticity
, orrecovery
.
- Redis elasticity test:
- Horizontal Scaling
0. In
scripts/redis-cluster-scale-horizontal.py
, modify the two variables to control the execution timeseconds_before_scale
andseconds_before_shrink
.python3 scripts/redis-cluster-scale-horizontal.py <num_initial_servers> <num_redis_clients> <memcached_ip>
- On another client node:
cd build && ./redis_perf <node-id> <num-local-threads> <num-total-threads> <memcached-ip> <workload> <redis-ip> <execution-time> <output-fname> cluster elasticity
. The<workload>
should be in[ycsba, ycsbb, ycsbc, ycsbd]
and The<execution-time>
controls how long each thread iterates with the workload. Note that this program will automatically read the workload file in../workloads/ycsb
, hence must be executed in thebuild
directory. An output will be written tobuild/results
as a json file.
- Vertical Scaling
0. In
scripts/redis-cluster-scale-vertical.py
, modify the two variables to control the execution timeseconds_before_scale
andseconds_before_shrink
.python3 scripts/redis-cluster-scale-horizontal.py <num_redis_clients> <memcached_ip>
- On another client node:
cd build && ./redis_perf <node-id> <num-local-threads> <num-total-threads> <memcached-ip> <workload> <redis-ip> <execution-time> <output-fname> cluster elasticity
. The<workload>
should be in[ycsba, ycsbb, ycsbc, ycsbd]
and The<execution-time>
controls how long each thread iterates with the workload. Note that this program will automatically read the workload file in../workloads/ycsb
, hence must be executed in thebuild
directory. An output will be written tobuild/results
as a json file.
- Horizontal Scaling
0. In
- DMC Sentinel test:
- Compute node failures
0. Prepare experiment settings:
- Start 2 DMC servers one primary and one backup.
- In
scripts/ycsb_dmc_sentinel.py
there are two variables to control the execution time of fail failing the primary node (seconds_before_fail
) and the time for recover the backup node (seconds_before_rereplicate
). - Indmc_cluster_config.json
setnum_initial_servers = 2
andnum_scale_servers = 3
. The IPs of DMC servers should also be set correctly. - Start a new backup during the experiment after theseconds_before_fail
.python scripts/ycsb_dmc_sentinel.py <memcached-ip> <num-clients>
.- On another client node:
cd build && ./redis_perf <node-id> <num-local-threads> <num-total-threads> <memcached-ip> <workload> <redis-ip> <execution-time> <output-fname> dmc_sentinel recovery
. The<workload>
should be in[ycsba, ycsbb, ycsbc, ycsbd, twitter-compute, twitter-storage, twitter-transient]
and The<execution-time>
controls how long each thread iterates with the workload. Note that this program will automatically read the workload file in../workloads/ycsb
, hence must be executed in thebuild
directory. An output will be written tobuild/results
as a json file.
- Memory node failures
0. Prepare experiment settings:
- Start 2 DMC servers one primary and one backup.
- In
dmc_cluster_config.json
setnum_initial_servers = 2
andnum_scale_servers = 2
. The IPs of DMC servers should also be set correctly. - Kill a memory node and rereplicate its memory regions.python scripts/ycsb_dmc_sentinel.py <memcached-ip> <num-clients>
.- On another client node:
cd build && ./redis_perf <node-id> <num-local-threads> <num-total-threads> <memcached-ip> <workload> <redis-ip> <execution-time> <output-fname> dmc_sentinel recovery
. The<workload>
should be in[ycsba, ycsbb, ycsbc, ycsbd, twitter-compute, twitter-storage, twitter-transient]
and The<execution-time>
controls how long each thread iterates with the workload. Note that this program will automatically read the workload file in../workloads/ycsb
, hence must be executed in thebuild
directory. An output will be written tobuild/results
as a json file.
- Compute node failures
0. Prepare experiment settings:
- Start 2 DMC servers one primary and one backup.
- In
Note 1: In all above commands, the <redis-ip>
field should be a URI with a scheme, e.g., tcp://127.0.0.1:7000
.
Note 2: Create a results
directory under the build
directory. Otherwise, results can be lost.
Note 3: When executing Twitter workloads, we do not load data first.
Note 4: For dmc_cluster
mode, we use dmc_cluster_config.json
to setup nodes in the cluster and the number of initial servers and the number of scale servers (for elasticity experiment).
Note 5: For Redis elasticity test, we use the <execution-time>
of redis-perf
to control the time for executing the workload.
{
"cont_tpt": [num_ops, num_ops, num_ops, ...], // record every 500ms
"cont_lat_map": [[[lat_us, time], [lat_us, time], ...],
[[lat_us, time], [lat_us, time], ...],
...], //record every 500ms
}
- Working on
redis-instance-starter.py
to start a single redis server instance or a redis cluster with multiple nodes- Single server mode
- Cluster mode with more than 3 nodes
- Cluster mode with less than 3 nodes