Dragonfly Client Performance Optimization Guidance
d7ycloudnativeperformancerust
Performance Optimization Guidance
This is a reference benchmark process document designed to assist in performance analysis and optimization for client. This document provides as general a testing framework as possible, allowing developers with needs to adjust it according to their specific circumstances across various platform.
Flow
Preparation
Step 1: Setup Dragonfly
- Please refer to official doc.
Step 2: Start a file server
- Start with docker:
[object Object], FILE_SERVER_PORT=12345 docker run -d --,[object Object], -p ,[object Object],:80 --name dragonfly-fs dragonflyoss/file-server:latest
- Check the file server is ready:
[object Object], curl -s -o /dev/null \ -w ,[object Object], \ http://localhost:12345/nano \ | grep -q ,[object Object], \ && ,[object Object], ,[object Object], \ || ,[object Object], ,[object Object],
- Optional:
you can build your own image, take a reference from Dockerfile.
Step 3: Install test tools
- Request Generator: oha
brew install oha
- Profiling: flamegraph
cargo install flamegraph
Step 4: Setup Dragonfly Peer
Document: Install with binary.
- Compile the target binary
cargo build --release --bin dfdaemon
- Connect to Dragonfly
[object Object], ./target/release/dfdaemon --config client.yaml -l info --verbose
FlameGraph
Now, let's start benchmark with the following params:
- $FILE_SERVER_ADDRESS
- $CLIENT_PROXY_ADDRESS
Collect Flamegraph
- Capture the flamegraph:
[object Object], ,[object Object], flamegraph -o my_flamegraph.svg --pid 3442
- Make the request:
oha -c 1000 \ -n 100 \ --rand-regex-url ,[object Object],/\(nano\|micro\|small\|medium\|large\) \ -x ,[object Object],