Open mperham opened 2 years ago
it may take 50-100ms to get a Ruby thread scheduled to process the PONG
More than that, even. Threads are only interrupted every 100ms, so the worse case scenario is NUMBER_OF_THREADS
* 100ms. Ouch!
@byroot is this something you would be interested in providing in hiredis-client?
Hum, perhaps, I'd need to have a look at how doable it would be. As I'd need to skip the reader code because it needs the GVL.
I'll have a quick look tomorrow.
Hi, I've been trying to monitor Redis network latency within Sidekiq by using
PING
but I've learned that a process pegged at 100% CPU will dramatically overstate latency due to thread scheduling latency around the GVL. If you have 10 jobs crunching numbers, it may take 50-100ms to get a Ruby thread scheduled to process the PONG. Would you be interested in a special PING impl which is designed only to calculate round trip time in C, so as to avoid Ruby VM overhead?I'm thinking something as simple as:
where the result is the calculated RTT in µs.
See also https://github.com/mperham/sidekiq/issues/5025