Skip to content
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

govpp: add rpc-service test to example perf-bench #253

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mohsinkazmi
Copy link
Contributor

Add support for RPC-service test.

func rpcTestAsync(conn api.Connection, cnt int) {
fmt.Printf("Running async RPC perf test with %d requests...\n", cnt)

ctxChan := make(chan memclnt.RPCService, cnt)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong. The memclnt.RPCService is a an interface of RPC service client that is needed to be created only once.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore rpcTestAsync function. It should have been deleted. you can check this function has never been called.

go func() {

for i := 0; i < cnt; i++ {
ctxChan <- c.ControlPing(context.Background(), &memclnt.ControlPing{})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't even compile. The ControlPing returns two values.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please Ignore it....

@@ -122,6 +125,46 @@ func main() {
time.Sleep(time.Second)
}

func rpcTest(conn api.Connection, cnt int) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function syncTest2 is optimized way to use stream. It does basically the same thing ControlPing RPC call does, but reused the same stream which makes it more performant.

Copy link
Member

@ondrej-fabry ondrej-fabry Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend reading Sending API messages from our GoVPP User Guide and RPC services and Stream API for more in-depth documentation of how it works.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using RPC services in our private application and can't change the whole code base to stream APIs. I have benchmarked them and got different results from stream APIs and RPC services API.
Thanks for the reading list. I have already read them.
The point here is to improve the overall performance of stream APIs and RPC service APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants