seneca-balance-client icon indicating copy to clipboard operation
seneca-balance-client copied to clipboard

add pattern - role:transport,type:balance,get:stats

Open rjrodger opened this issue 9 years ago • 11 comments

the balance-client should collect performance stats on the health of targets, this can then be used to implement circuit breakers etc

rjrodger avatar Dec 02 '15 18:12 rjrodger

Is this implemented anywhere else that I can use as a reference?

cjihrig avatar Dec 03 '15 21:12 cjihrig

@cjihrig regarding health, I don't think so. Mainly because we need to define what is health for a target.

I would say that the only metric that is available is "number of messages sent but not replied to" a given target. Not sure how to get it in a non obtrusive way (and without a perf hit).

mcollina avatar Dec 04 '15 08:12 mcollina

As a quick win, you can repurpose the rolling-stats module as used in Seneca main and use it in the same way to count and time messages responses: https://github.com/rjrodger/rolling-stats https://github.com/senecajs/seneca/blob/master/seneca.js#L1068 /cc @geek

What you will need to figure out is how to handle:

  • primary pin may be a glob, so you need to capture on args.meta$.pattern to get the concrete pattern
  • different target lifetimes - a target at a particular location (ip and port) is actually a series of temporal incarnations (restarts, updated deployments, change of underlying AWS instance, etc, etc), so identity cannot just be expressed by location

/cc @mcdonnelldean it should be possible to capture and chart this data into the dashboard - consider how you would want to do that

@cjihrig the purpose of the get:stats pattern is to provide information to balancing strategies - e.g reduce load on slow service etc

rjrodger avatar Dec 04 '15 11:12 rjrodger

@cjihrig it would help you a lot to run through the nodezoo workshop: https://github.com/rjrodger/nodezoo

in particular, you can add balancing scenarios:

  • have multiple search services and use the balance-client over them, actor model
  • have multiple npm and git services, publish model (who cares if they perform the same work twice! redundancy ftw :) )

rjrodger avatar Dec 04 '15 11:12 rjrodger

@cjihrig We should probably talk in the new year on this too. I have some examples of charting similar info I want to show you for context.

mcdonnelldean avatar Dec 18 '15 12:12 mcdonnelldean

@rjrodger I might close and reframe this. There is a lot of could ideas in this. I have someone in mind but I think there are a lot of details we could pull out of this. I would be super interested to know the round robin stats for a particular service for instance.

For now I've added enhancement but this is something I definitely want to explore as I don't think we take nearly as much advantage of these sorts of patterns as we can and should.

mcdonnelldean avatar Apr 10 '16 12:04 mcdonnelldean

Hi @mcdonnelldean. I am working in something related to stats and circuit breaking and I am actually modifying now seneca-balance-client (I have done it but I am trying to debug a tricky error) to introduce circuit breaking capabilities as well as stats collection. I think it might be worth having a talk to brainstorm ideas.

dgonzalez avatar Apr 26 '16 09:04 dgonzalez

For sure, I am out all this week but let's catch up when I get back.

mcdonnelldean avatar Apr 26 '16 10:04 mcdonnelldean

Perfecto. I'll put something down in the diary.

dgonzalez avatar Apr 26 '16 11:04 dgonzalez

Do, send me on a calendar invite. @mcollina yourself or Dave may want to sit in on this each to see what sort of stats are being emitted?

mcdonnelldean avatar Apr 26 '16 11:04 mcdonnelldean

Yup. Id like to sit in there. I have a branch already with something going on. Ill send the invite. On 26 Apr 2016 12:12 p.m., "Dean McDonnell" [email protected] wrote:

Do, send me on a calendar invite. @mcollina https://github.com/mcollina yourself or Dave may want to sit in on this each to see what sort of stats are being emitted?

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/rjrodger/seneca-balance-client/issues/7#issuecomment-214705438

dgonzalez avatar May 23 '16 16:05 dgonzalez