Hi,
I’m working with Rails 7 and Ruby 3.0.0. I’m using one Sidekiq worker with concurrency set to 1. Inside the job, I’m spawning 10 additional threads to verify emails.
After some time, I receive this warning:
"Your Sidekiq Redis network connection is experiencing performance issues.
Your Redis network connection is performing extremely poorly. Last RTT readings were [99835, 99949, 99907, 102789, 99945], ideally these should be < 1000. Ensure Redis is running in the same AZ or datacenter as Sidekiq. If these values are close to 100,000, that means your Sidekiq process may be CPU-saturated; reduce your concurrency."
At this point, the job gets stuck and the CPU becomes fully saturated. As worker (htop ) shows it is using 100% CPU.
I’ve read many articles about this issue, but nothing has worked so far. I’m running the job on a server with 2 CPU cores and 4 GB RAM. One possible reason I’ve identified is that the internal threads may be getting stuck and causing CPU contention.
Has anyone else faced this issue?
If yes, how did you determine the optimal number of threads inside the job so that the CPU doesn’t get saturated?