Sidekiq: Sidekiq should set CLIENT SETNAME for debugging

Created on 14 Jun 2017  路  5Comments  路  Source: mperham/sidekiq

Redis's CLIENT SETNAME allows the client to give info about the connection for debugging purposes. You cannot include spaces in the ID. My initial idea is this ID:

ruby options[:id] ||= "Sidekiq-#{Sidekiq.server? ? "server" : "client"}-PID-#{$$}"

Any other suggestions for useful info to include?

Most helpful comment

If your Redis server administrator has renamed the CLIENT command (to prevent CLENT KILLs):

All 5 comments

PID isn't useful in containerized environments. Hostname would be the container id and would be far more useful to me.

Good point, I'm not sure if I should assume containers or not. Notice the hammer operator; the default id can be customized:

config.redis = { :id => '...' }

I've never heard it called the "hammer operator" before. That's great.

I left it as is. The remote IP should already be available in the list of connections. The PID is there to narrow down which process on that host/container.

If your Redis server administrator has renamed the CLIENT command (to prevent CLENT KILLs):

Was this page helpful?
0 / 5 - 0 ratings