Module: kamailio
Branch: master
Commit: 61d1fbcc8c193568b4a7728d25be565ac761ea6f
URL:
https://github.com/kamailio/kamailio/commit/61d1fbcc8c193568b4a7728d25be565…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-10-17T12:47:16+02:00
pipelimit: allow to disable fetching cpu and network load
- prevent usage of high cpu when related algoritms are not used
- can be controlled via load_fetch parameter
- GH #1675
---
Modified: src/modules/pipelimit/pipelimit.c
---
Diff:
https://github.com/kamailio/kamailio/commit/61d1fbcc8c193568b4a7728d25be565…
Patch:
https://github.com/kamailio/kamailio/commit/61d1fbcc8c193568b4a7728d25be565…
---
diff --git a/src/modules/pipelimit/pipelimit.c b/src/modules/pipelimit/pipelimit.c
index 7aff821930..46e3a45b7e 100644
--- a/src/modules/pipelimit/pipelimit.c
+++ b/src/modules/pipelimit/pipelimit.c
@@ -113,6 +113,7 @@ static int pl_timer_mode = 0;
int _pl_cfg_setpoint = 0; /* desired load, used when reading modparams */
/* === */
+static int pl_load_fetch = 1;
/** module functions */
static int mod_init(void);
@@ -150,6 +151,7 @@ static param_export_t params[]={
{"plp_limit_column", PARAM_STR, &rlp_limit_col},
{"plp_algorithm_column", PARAM_STR, &rlp_algorithm_col},
{"hash_size", INT_PARAM, &pl_hash_size},
+ {"load_fetch", INT_PARAM, &pl_load_fetch},
{0,0,0}
};
@@ -727,13 +729,15 @@ static int fixup_pl_check3(void** param, int param_no)
static void pl_timer_refresh(void)
{
- switch (*load_source) {
- case LOAD_SOURCE_CPU:
- update_cpu_load();
- break;
- }
+ if(pl_load_fetch!=0) {
+ switch (*load_source) {
+ case LOAD_SOURCE_CPU:
+ update_cpu_load();
+ break;
+ }
- *network_load_value = get_total_bytes_waiting();
+ *network_load_value = get_total_bytes_waiting();
+ }
pl_pipe_timer_update(pl_timer_interval, *network_load_value);
}