-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the benchmark test for vineyard clients. (#1966)
Fixes #1946 Signed-off-by: Ye Cao <caoye.cao@alibaba-inc.com>
- Loading branch information
Showing
7 changed files
with
908 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
if(BUILD_VINEYARD_MALLOC) | ||
add_subdirectory(alloc_test) | ||
add_subdirectory(blob_test) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
set(BENCH_BLOB_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/blob_test.cc) | ||
|
||
if(BUILD_VINEYARD_BENCHMARKS_ALL) | ||
set(blob_benchmark_options "") | ||
else() | ||
set(blob_benchmark_options "EXCLUDE_FROM_ALL") | ||
endif() | ||
|
||
add_executable(blob_benchmark ${blob_benchmark_options} ${BENCH_BLOB_SRCS}) | ||
|
||
target_include_directories(blob_benchmark PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
target_link_libraries(blob_benchmark PRIVATE vineyard_client) | ||
|
||
add_dependencies(vineyard_benchmarks blob_benchmark) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Blob benchmark test | ||
|
||
In the blob benchmark test, we will focus on the performance of the basic blob | ||
operations: | ||
|
||
- `PutBlob`: Put data into local vineyard. It contains two steps: first, create a blob in vineyard, then copy the data into the blob. | ||
- `GetBlob`: Get data from local vineyard. | ||
- `PutBlobs`: Put multiple blobs into local vineyard. | ||
- `GetBlobs`: Get multiple blobs from local vineyard. | ||
- `PutRemoteBlob`: Put data into remote vineyard. Unlike `PutBlob`, the data is prepared beforehand and then copied into a Vineyard blob. Therefore, this operation avoids manual memory copying. | ||
- `GetRemoteBlob`: Get data from remote vineyard. | ||
- `PutRemoteBlobs`: Put multiple blobs into remote vineyard. | ||
- `GetRemoteBlobs`: Get multiple blobs from remote vineyard. | ||
|
||
Also, the performance is measured in terms of **throughput** and **latency**. | ||
|
||
## Build the benchmark | ||
|
||
Configure with the following arguments when building vineyard: | ||
|
||
```bash | ||
cmake .. -DBUILD_VINEYARD_BENCHMARKS=ON | ||
``` | ||
|
||
Then make the following targets: | ||
|
||
```bash | ||
make vineyard_benchmarks -j | ||
``` | ||
|
||
The artifacts will be placed under the `${CMAKE_BINARY_DIR}/bin/` directory: | ||
|
||
```bash | ||
./bin/blob_benchmark | ||
``` | ||
|
||
## Run the benchmark with customized parameters | ||
|
||
**Important** Before running the benchmark, you need to start the vineyard server first. You could refer to the [launching vineyard server guide](https://v6d.io/notes/getting-started.html#launching-vineyard-server) for more information. | ||
|
||
After that, you could get the help information by running the following command: | ||
|
||
```bash | ||
./bin/blob_benchmark --help | ||
Usage: ./bin/blob_benchmark [OPTIONS] | ||
Options: | ||
-h, --help Show this help message and exit | ||
-i, --ipc_socket=IPC_SOCKET Specify the IPC socket path (required) | ||
-r, --rpc_endpoint=RPC_ENDPOINT Specify the RPC endpoint (required) | ||
-d, --rdma_endpoint=RDMA_ENDPOINT Specify the RDMA endpoint (required) | ||
-c, --clients_num=NUM Number of clients (required) | ||
-s, --data_size=SIZE Data size (e.g., 1KB, 1MB) (required) | ||
-n, --requests_num=NUM Number of requests (required) | ||
-t, --num_threads=NUM Number of threads (required) | ||
-o, --operation=TYPE Operation type (put_blob, get_blob, put_blobs, get_blobs, put_remote_blob, get_remote_blob, put_remote_blobs, get_remote_blobs) (required) | ||
``` | ||
|
||
For example, you could run the following command to test the performance of `PutBlob`: | ||
|
||
```bash | ||
./bin/blob_benchmark -i /tmp/vineyard.sock -r "127.0.0.1:9600" -d "" -c 50 -s 8MB -n 1000 -t 10 -o "put_blob" | ||
``` |
Oops, something went wrong.