文件最后提交记录最后更新时间
correct redis tuning server yaml param type and example README Signed-off-by: hubin <hubin73@huawei.com>3 年前
update examples/tuning/redis/benchmark.py. Traceback (most recent call last): File "/root/benchmark.py", line 52, in <module> total_queries += float(line.split(',')[1].replace('"', '')) ValueError: could not convert string to float: 'lrange_600 --csv: 0.00' 解决这个python的换行符“\”带来的错误。3 年前
Redis tuning files by Yingjie Shang. rename redis_benchmark_client to redis_client some parameters change directory of benchmark to cwd remove move statment modify redis_server.yaml move client and server YAML under yingjie/ uncomment lines. delete empty lines and a statement of random_start remove yingjie/ add in new parameters for redis Add description of post work after deploy for tunning. Add another contributor. Add redis_client and redis_server YAML files enrich tunning part rm blank line recover wrong delete of file remove blank line correct word spell add redis.client-timeout Add part of how to modify server-side YAML based on scenarios. add suggestion comment for unixsocket4 年前
Add deployment script for Redis and its benchmark.4 年前
update examples/tuning/redis/redis_benchmark_client.yaml. 修改路径为./redis_benchmark.sh,不然执行命令找不到文件3 年前
update examples/tuning/redis/redis_benchmark_server.yaml. 修改server.yaml文件中的拼写错误,并新增4个会影响性能的参数。3 年前
update examples/tuning/redis/redis_client.yaml. 添加参数“random_starts: 10”3 年前
correct redis tuning server yaml param type and example README Signed-off-by: hubin <hubin73@huawei.com>3 年前
README.md

Deployment script for Redis and its benchmark

Before running the script, you may want to read this guide first.

The goal is to deploy redis-server on localhost, redis-benchmark on another host for future tunning work.

Deploy ⚙️

To run the script, execute bash prepare.sh.

  1. Enter the IP address and port number(skip to default) of the redis-server host.
  2. Enter the IP address of the redis-benchmark host.
  3. Enter 'y' to generate and deploy the new SSH key on the benchmark host, or skip if the SSH key is configured.
  4. Enter the password for access benchmark host.

That is all you need to interact with the script.

Benchmark ⏱️

To start the benchmark, execute bash redis_benchmark.sh, the localhost will access the benchmark host and trigger it.

The benchmark host will transfer the log file to localhost after the benchmark.

Tunning 🔧

There are currently two server-side YAML files, and you can choose to use one of them.

After running the deployment script, copy the server-side YAML which you want to use to /etc/atuned/tuning/

Modify Server-side YAML (optional)

Some parameters are unsuitable for all scenarios, so I write a particular bash script and corresponding options.

If some are not suitable for your scenarios, remove the option which could trigger the script to modify the system.

Including: redis.RDB, redis.AOF and redis.unixsocket.

Use redis.unixsocket as an example. According to Redis official documentaion: https://redis.io/docs/reference/optimization/benchmarks/#factors-impacting-redis-performance

When the server and client benchmark programs run on the same box, both the TCP/IP loopback and unix domain sockets can be used. Depending on the platform, unix domain sockets can achieve around 50% more throughput than the TCP/IP loopback (on Linux for instance). The default behavior of redis-benchmark is to use the TCP/IP loopback.

So, if you want to enable this parameter, add a "yes" option to it.

  - name: "redis.unixsocket"
    info:
      desc: "use unix domain sockets to communicate.(benefit when client and server running on same box)"
      get: value="not set"; if grep -P '^maxclients' /etc/redis.conf; then value="$(grep -P '^unixsocket' /etc/redis.conf)"; fi ;echo "${value}"
      set: if [ "$value" = "yes" ]; then sed -i "/# unixsocketperm /a unixsocket /tmp/redis.sock" ./test; sed -i "/^unixsocket /a unixsocketperm 700" ./test; fi
      needrestart: "true"
      type: "discrete"
      dtype: "string"
      options:
        - "no"
        - "yes"

Start to tuning

atune-adm tuning --project PROJECT --detail ./CLIENT.yaml

eg: atune-adm tuning --project redis --detail ./redis_client.yaml

Restore the environment

atune-adm tuning --restore --project PROJECT

eg: atune-adm tuning --restore --project redis

To contact ✉️

chengyu

yingjie