-
Notifications
You must be signed in to change notification settings - Fork 140
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
rpc latency suddenly increases when client sleeps for a while after rpc call #104
Comments
This is interesting, it's likely a bug in how eRPC implements packet retransmissions ( eRPC/src/rpc_impl/rpc_pkt_loss.cc Line 12 in 094c17c
Because the time between event loop invocations can be larger than eRPC's retransmission timeout, the code wrongly assumes that packets have been lost. This can be fixed. If you have a patch, I can merge it. |
I'm afraid this is not the root cause - even after I commented out this if clause ( eRPC/src/rpc_impl/rpc_ev_loop.cc Line 32 in 094c17c
|
@ankalia Do you think it might be related to rdtsc()? I found eRPC heavily relies on rdtsc() for timing. Since user applications can't guarantee to keep the CPU 100% busy, I suspect timing based on TSC would be inaccurate and may cause strange issues. |
rdtsc always ticks at the same speed regardless of whether the core is active/asleep. JFYI: I currently don't have the cycles to debug this in detail. |
Hi,
When I ported eRPC to my system, I measured the latency of the RPC call and surprisingly found it to be very high (up to 10s of ms). To reproduce the results, here is the simplified program based on the hello_world example.
So if you comment out the sleep function after the rpc call, the results are good - ~10us avg latency. However, if you do not, the latency rises up to 370us. And furthermore, if you sleep longer, like 100ms, the latency then increases to 4.5ms.
I've done some debugging on eRPC and found out that if I do sleep, there are re-transmissions for each request and it seems likely to be the reason for the latency issue.
I think this pattern should be very common though: user calls an RPC, does some processing (which may take some time as I simulated by a sleep), and repeats. Is it a bug or a feature? If it's a feature, how would you suggest I handle my use case? Thank you!
The text was updated successfully, but these errors were encountered: