[sr-dev] [kamailio/kamailio] dispatcher: latency statistics (#1234)

Julien Chavanton notifications at github.com
Thu Sep 14 05:34:58 CEST 2017


#### Pre-Submission Checklist
- [ X] Commit message has the format required by CONTRIBUTING guide
- [ X] Commits are split per component (core, individual modules, libs, utils, ...)
- [ X] Each component has a single commit (if not, squash them into one commit)
- [ X] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)

#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [ X] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)

#### Checklist:
- [ ] PR should be backported to stable branches
- [ X] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)

#### Description
With the proposed modification the dispatcher can now compute the latency of all the nodes it is pinging and also report timeouts counts.

Default module behavior is unchanged, the stats needs to be explicitly activated.

In this first stage, the objective is to start to monitor latency and intermittent timeouts and share the result to be used by an external monitoring system.

The metrics are only expose using `kamcmd dispatcher.list` maybe they should be made available elsewhere, for example from the routing script ? but this can be done later ...
```
DEST: {
	URI: sip:1.2.3.4
	FLAGS: AX
	PRIORITY: 9
	LATENCY: {
		AVG: 24.250000 # weigthed moving average for the last few weeks
		STD: 1.035000  # standard deviation of AVG
		EST: 25.000000 # short term estimate, see parameter: ds_latency_estimator_alpha
		MAX: 26        # maximun value seen
		TIMEOUT: 0     # count of ping timeouts
	}
}
```

Another stage would probably be to adjust the load distribution/weight considering the latency estimator, the dispatcher would be able to detect intermittent remote server lags and minimize the impact.

tested :

Some tests done on the calculation generating billions of fake samples to verify calculations.

ds_reload : 
- safe because it is using a blue/green update keeping the active version while creating the new one
- this will currently reset the stats


You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/1234

-- Commit Summary --

  * dispatcher: latency statistics

-- File Changes --

    M src/modules/dispatcher/dispatch.c (87)
    M src/modules/dispatcher/dispatch.h (13)
    M src/modules/dispatcher/dispatcher.c (28)
    M src/modules/dispatcher/doc/dispatcher.xml (9)
    M src/modules/dispatcher/doc/dispatcher_admin.xml (75)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/1234.patch
https://github.com/kamailio/kamailio/pull/1234.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1234
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20170914/8f732114/attachment-0001.html>


More information about the sr-dev mailing list