![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
hystrix-too-busy
Advanced tools
Readme
Provides a back-pressure management based on hystrix command and too-busy module logic, utilizing hystrix metrics accumulation and circuit breaking capabilities to avoid false positives generated by plain toobusy-js module.
The importance of maintaining the stability of the system is hard to argue. There are many different techniques on how to achieve this. One of them is based on determining how busy the system based on a latency related to event loop by measuring between expected and actual time when measured timer event happens.
One of the popular modules is toobusy-js, but it does not work as expected and can generate false positives (busy signal) under relatively small load (20% CPU) due to GC memory profile or an application logic. What was missing is a floating window of measurements over specific period of time; which would provide better data to decide if the system is really busy.
Hystrix component provides a fail fast pattern on top of the statistics it collects and that makes it a perfect candidate to add to toobusy-js module to close this gap.
The module defines a hystrix command that executes toobusy check and emits back an error which is used by hystrix to calculate number of errors towards circuit opening.
Once the circuit is open it will stay open till the next sleep window, which will lead to generating a constant signal to the client that the system is busy.
Since it is based on hystrix, it makes all the statistic available to hystrix dashboard and can be integrated into the same node app or plugged into standalone hystrix dashboard.
$ npm install hystrix-too-busy -S
require('hystrix-too-busy').getState(busy => {
console.log('I am', busy ? 'busy' : 'free');
})
// or for specific command
require('hystrix-too-busy').getState('fooCommand', busy => {
console.log(`fooCommand is ${busy ? 'busy' : 'free'}`);
})
Since this module is based on both too-busy and hystrixjs you need to understand how different parameters affect the outcome, which in our case is a signal that the system is in stress mode and need to shed some load.
toobusy settings:
The default configuration used by the module:
require('hystrix-too-busy').init({
latencyThreshold: 70,
interval: 500,
smoothingFactor: 0.33,
default: {
circuitBreakerErrorThresholdPercentage: 50,
circuitBreakerForceClosed: false,
circuitBreakerForceOpened: false,
circuitBreakerRequestVolumeThreshold: 20,
circuitBreakerSleepWindowInMilliseconds: 5000,
requestVolumeRejectionThreshold: 0,
statisticalWindowNumberOfBuckets: 10,
statisticalWindowLength: 10000,
percentileWindowNumberOfBuckets: 6,
percentileWindowLength: 60000
}
});
Since the module is based on hystrix, we can re-use the command concept to provide different behavior of the circuit breaker. This can allow us to give priorities for some commands over the other, i.e. unimportant commands will get short circuited sooner than the more important ones.
By default all calls to the module will be treated as a single command using default config.
You can configure specific command and only what is different from default config. If some command config is not found, it will use default configuration.
require('hystrix-too-busy').init({
latencyThreshold: 70,
interval: 500,
smoothingFactor: 0.33,
commands: {
fooCommand: {
circuitBreakerErrorThresholdPercentage: 80,
circuitBreakerRequestVolumeThreshold: 1
},
barCommand: {
circuitBreakerErrorThresholdPercentage: 30
}
}
});
FAQs
Provides a backpressure management hystrix command partially based on too-busy module logic and utilizing hystrix metrics accumulation and circuit breaking
The npm package hystrix-too-busy receives a total of 27 weekly downloads. As such, hystrix-too-busy popularity was classified as not popular.
We found that hystrix-too-busy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.