Best practices to define GroupKey and CommandKey

1,684 views
Skip to first unread message

Yaowen Tu

unread,
Oct 28, 2014, 10:06:47 PM10/28/14
to hystr...@googlegroups.com
Hi Hystrix experts:

We are starting to integrate Hystrix with our own memcached library. We have a generic memcached class so that different caches can extend from it to performance Set/Get, but we don't want to define different Get or Set Command for each cache so we are trying to find a way to differentiate them and tune them separately.

There are two ways to do it:

First, we can provide different CommandKey, so the config looks like this:
      hystrix.command.cacheOneGetCommand.circuitBreaker.sleepWindowInMilliseconds=200
      hystrix.command.cacheTwoGetCommand.circuitBreaker.sleepWindowInMilliseconds=200

Second, we can define some prefix for the cache so it looks like:
      cacheOne.command.default.circuitBreaker.sleepWindowInMilliseconds=200
      cacheTwo.command.default.circuitBreaker.sleepWindowInMilliseconds=200


The first is much easier to implement, but second is also not very hard by defining our own HystrixPropertiesStrategy. We prefer the second way because it is more flexible. We can still use "default" in each cache.

But we found it breaks the hystrix-dashboard, because in the second way, commandKey is same for all caches, and we will see many GetCommand metrics but cannot tell which is which.

Questions:
1) Is there a easy way to show group key along with the command key in dashboard? Or why we don't show it by default? What's the concern?

2) Regarding two solutions, which is better? What's the best practices?


We just started the project to integrate hystrix with all caches, so we are trying to learn those area other than the core feature. I am sure other people have had the same experiences so hopefully someone could share their thought?

Best,
Yaowen

Ben Christensen

unread,
Oct 29, 2014, 1:08:26 PM10/29/14
to Yaowen Tu, hystr...@googlegroups.com
At Netflix we have not attempted to apply config to groups, only global defaults and then per-command overrides. You can of course modify that behavior using the plugin as you mention for your use case. The plugin was created exactly for these type of local customizations. 

The dashboard does not show the groupKey but that could be modified fairly easily since the event stream contains the groupKey in it. There is no concern, it just wasn’t ever done. 

-- 
Ben Christensen - Netflix Edge Engineering
+1.310.782.5511  @benjchristensen
--
You received this message because you are subscribed to the Google Groups "HystrixOSS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hystrixoss+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages