Merge pull request #4 from sofastack/feature/custom_serialization feat(TriplePojoBenchmark): 添加序列化配置选项
Merge pull request #4 from sofastack/feature/custom_serialization
feat(TriplePojoBenchmark): 添加序列化配置选项
This project focuses on benchmarking and profiling SOFARPC with different protocol and serialization options. The code and the idea behind it is inspired by Dubbo Benchmark.
sofa-rpc-bolt-hessian-server
client
sofa-rpc-triple-pojo-server
UserPojoService
sofa-rpc-triple-proto-server
IUserService
# Terminal 1: start server (default port 12200) ./benchmark.sh sofa-rpc-bolt-hessian-server # Terminal 2: start client ./benchmark.sh sofa-rpc-bolt-hessian-client
./benchmark.sh -m profiling sofa-rpc-bolt-hessian-server ./benchmark.sh -m profiling sofa-rpc-bolt-hessian-client
TripleClient benchmarks all four call modes of UserPojoService:
TripleClient
unary
getUser
serverStream
listUserServerStream
clientStream
batchCreateUserClientStream
biStream
verifyUserBiStream
# Terminal 1: start server (default port 50051) ./benchmark.sh -p 50051 sofa-rpc-triple-pojo-server # Terminal 2: start client # Note: use 127.0.0.1 instead of localhost to avoid IPv6 proxy issues ./benchmark.sh -s 127.0.0.1 -p 50051 sofa-rpc-triple-pojo-client
Triple Pojo supports configurable serialization via -S (default: hessian2). Both server and client must use the same serialization type.
-S
hessian2
# Use JSON serialization ./benchmark.sh -s 127.0.0.1 -p 50051 -S json sofa-rpc-triple-pojo-client
TripleProtoClient benchmarks all four call modes of IUserService using Protobuf wire format:
TripleProtoClient
batchCreateUser
# Terminal 1: start server (default port 50052) ./benchmark.sh -p 50052 sofa-rpc-triple-proto-server # Terminal 2: start client ./benchmark.sh -s 127.0.0.1 -p 50052 sofa-rpc-triple-proto-client
-m
benchmark
profiling
-m profiling
-s
-s 127.0.0.1
-p
-p 50051
-f
-f result.json
-t
-t 64
protobuf
json
-S json
-e
-e "-Drequest.size=10240"
-a
-a "--warmupIterations=3"
./benchmark.sh -p 12201 sofa-rpc-bolt-hessian-server ./benchmark.sh -s 127.0.0.1 -p 12201 -f result.json -t 64 sofa-rpc-bolt-hessian-client
./benchmark.sh -a "--warmupIterations=3 --warmupTime=10 --measurementIterations=3 --measurementTime=150" sofa-rpc-bolt-hessian-client
./benchmark.sh -e "-Drequest.size=10240 -Dresult.format=TEXT" sofa-rpc-bolt-hessian-client
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
SOFARPC Benchmark
This project focuses on benchmarking and profiling SOFARPC with different protocol and serialization options. The code and the idea behind it is inspired by Dubbo Benchmark.
Modules
sofa-rpc-bolt-hessian-server/clientsofa-rpc-triple-pojo-server/clientUserPojoService(POJO, unary + streaming)sofa-rpc-triple-proto-server/clientIUserService(Protobuf, unary + streaming)Bolt + Hessian Benchmark
Run Benchmark
Run Profiling
Triple Benchmark
TripleClientbenchmarks all four call modes ofUserPojoService:unarygetUser)serverStreamlistUserServerStream)clientStreambatchCreateUserClientStream)biStreamverifyUserBiStream)Run Benchmark
Specify Serialization
Triple Pojo supports configurable serialization via
-S(default:hessian2). Both server and client must use the same serialization type.Triple Proto Benchmark
TripleProtoClientbenchmarks all four call modes ofIUserServiceusing Protobuf wire format:unarygetUser)serverStreamlistUserServerStream)clientStreambatchCreateUser)biStreamverifyUserBiStream)Run Benchmark
Common Parameters
-mbenchmarkorprofiling)-m profiling-s-s 127.0.0.1-p-p 50051-f-f result.json-t-t 64-Shessian2,protobuf,json)-S json-e-e "-Drequest.size=10240"-a-a "--warmupIterations=3"Specify port, host, output file, thread count
Specify JMH warmup and measurement iterations
Specify request size and result format