From osas@voipembedded.com Mon Jan 12 15:00:42 2015 From: Ovidiu Sas To: sr-dev@lists.kamailio.org Subject: Re: [sr-dev] git:master:e688d656: modules/cdp: new mod param: workerq_length_threshold_percentage Date: Mon, 12 Jan 2015 09:00:36 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0755253701==" --===============0755253701== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable In addition to the warning, it would be nice to run a script callback via a dedicated route, to let the admin take some decisions in real time. Regards, Ovidiu Sas On Jan 12, 2015 8:16 AM, "Richard Good" wrote: > Module: kamailio > Branch: master > Commit: e688d656427dd00d48f1e309c5d8ef991e432b67 > URL: > https://github.com/kamailio/kamailio/commit/e688d656427dd00d48f1e309c5d8ef9= 91e432b67 > > Author: Richard Good > Committer: Richard Good > Date: 2015-01-12T15:08:08+02:00 > > modules/cdp: new mod param: workerq_length_threshold_percentage > > This is the threshold of the length of the worker queue as a percentage of > the maximum queue size - when exceeded a warning is written to the log > file. Nice to check if worker queue is growing. > > --- > > Modified: modules/cdp/doc/cdp_admin.xml > Modified: modules/cdp/mod.c > Modified: modules/cdp/worker.c > > --- > > Diff: > https://github.com/kamailio/kamailio/commit/e688d656427dd00d48f1e309c5d8ef9= 91e432b67.diff > Patch: > https://github.com/kamailio/kamailio/commit/e688d656427dd00d48f1e309c5d8ef9= 91e432b67.patch > > --- > > diff --git a/modules/cdp/doc/cdp_admin.xml b/modules/cdp/doc/cdp_admin.xml > index cdf65d2..234e270 100644 > --- a/modules/cdp/doc/cdp_admin.xml > +++ b/modules/cdp/doc/cdp_admin.xml > @@ -126,6 +126,24 @@ modparam("cdp", "latency_threshold", 1000) > > > > +
> + workerq_length_threshold_percentage (int) > + > + The threshold of the length of the worker queue as a > percentage of > + the maximum queue size - when exceeded a warning is written to > the log > + file. 0 means disabled > + > + Default value is 0. > > + > + > + Set <varname>workerq_length_threshold_percentage</varname> > parameter > + > + ... > +modparam("cdp", "workerq_length_threshold_percentage", 25) > +... > + > + > +
> > >
> diff --git a/modules/cdp/mod.c b/modules/cdp/mod.c > index 6857d82..90900d3 100644 > --- a/modules/cdp/mod.c > +++ b/modules/cdp/mod.c > @@ -62,6 +62,7 @@ char* config_file=3D"DiameterPeer.xml"; /**< > default DiameterPeer configuration f > unsigned int latency_threshold =3D 500; /**< default > threshold for Diameter calls (ms) */ > unsigned int *latency_threshold_p =3D &latency_threshold; > unsigned int workerq_latency_threshold =3D 100; /**< default threshold for > putting a task into worker queue (ms) */ > +unsigned int workerq_length_threshold_percentage =3D 0; /**< default > threshold for worker queue length, percentage of max queue length - by > default disabled */ > > extern dp_config *config; /**< DiameterPeer > configuration structure */ > > @@ -165,6 +166,7 @@ static param_export_t cdp_params[] =3D { > { "config_file", PARAM_STRING, > &config_file}, /**< configuration filename */ > { "latency_threshold", PARAM_INT, > &latency_threshold}, /** { "workerq_latency_threshold", PARAM_INT, > &workerq_latency_threshold},/**