-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The goVPP synchronous API exhibits slow performance. #254
Comments
Thank you @mohsinkazmi for providing the PR with the RPC perf test code. Here are the results reproduced on my local machine. RPC
Channel
Stream
Channel async
Stream async
All measurements below were done using the Stream API and [1] Stream request/reply per method duration (better result):
[2] Stream request/reply per method duration (worse results):
Despite the request being a bit slower in [1], the overall request duration was much faster due to the quick response. The slowest operation in the request is writing to the socket followed by the encoding and Test with 2M One of my thoughts was that those latency spikes are caused by GC procedures (STW). Here are the results from the memory profiler for simple APIs and regular VPP configuration (creating objects, etc) using with the latest GoVPP: Simple API
VPP API
Short explanation - I created this experimental change to decrease the amount of allocated objects #262, and re-run both tests. Simple API patched
The allocated memory/objects decreased by around 5% and RPS went up from 13.5k to 16k. VPP API patched
Here the decreased memory allocation is even more apparent, but the RPS gain is only small. I also run stream API test with 2M requests, and got RPS 16552 (compared to 15954 RPS with unpatched version). @mohsinkazmi as per our previous discussion, here are additional points to investigate:
|
Description
Upon restart, the agent sends numerous API calls to configure VPP (with a count of 2,100,140), but the process takes a significant amount of time to complete. I benchmarked the goVPP APIs using the perf-bench example, and the results indicate that the performance of the RPC, SYNC channel, and SYNC stream is inadequate and requires substantial improvement. These components should be capable of achieving a minimum rate of 30K operations per second.
How to reproduce
Steps to reproduce the behavior:
I used target rate of 2,100,140 to profile and benchmark the goVPP API. Below is the exact command line utilized for the benchmarking process.
sudo ./perf-bench --api-socket /run/vpp/api.sock --count=2100140 --rpc
sudo ./perf-bench --sync --api-socket /run/vpp/api.sock --count=2100140
sudo ./perf-bench --sync --api-socket /run/vpp/api.sock --count=2100140 --v2
sudo ./perf-bench --api-socket /run/vpp/api.sock --count=2100140
sudo ./perf-bench --api-socket /run/vpp/api.sock --count=2100140 --v2
Kindly use the following PR #253 to incorporate support for RPCs into the perf-bench example.
RPC
Channel
Stream
Channel Async (use another go routine)
Stream Async (use another go routine)
Environment
To compare the results with the C API bindings (shared memory for now):
Please fetch or pull the patch which adds support for benchmarking the C API bindings in VAT2:
https://gerrit.fd.io/r/c/vpp/+/42105
Compile and run VPP.
C API Async performance:
C API Sync performance:
The text was updated successfully, but these errors were encountered: