Hi Prashant,
If I were to do it the lazy way and if I have understood your requirement completely. I might've ended up using snmp monitoring of the CPU and set a memcache/redis variable to be 0 or 1 in case CPU goes above or below 70.
In my kamailio.cfg I would just check that redis variable and decide whether to drop requests or continue with the config.

Isn't that something that can help you ?

Thanks,
Sammy

On Mar 1, 2016 09:00, "Prashant Desai" <pdesai05@gmail.com> wrote:

Hi Kamailio,

                We are using Kamailio V4.2.3 for our project and we are trying to address the performance requirement. We have following queries

and need some inputs from Kamailio.

 

Requirement : CPU Utilization Limit to 70%, If the limit is crossed Kamailio has to reject the Request.

And If it is within the limit Kamailio has to Process the Requests. (i.e. Kamailio has to dynamically set and reset the policy based on CPU Load).

 

Our Findings : We have come across ratelimit module in Kamailio, we tried using the same to address the requirement

but we see it is not  dynamically setting and resetting the policy (once if it starts rejecting then every time it rejects it, only if we restart the kamailo it works)

 

What we Need: We need to know

1.       Are we using the right module to address the above requirement ?

2.       We are only using ratelimit, module, do we have to include any other module along with ratelimit?

3.       We are using FEEDBACK algorithm, is that OK ?

4.       Setting  “ modparam("ratelimit", "pipe", "3:FEEDBACK:70") “ , is this correct ?

5.       In ratelimit.c , function

 static int pipe_push(struct sip_msg * msg, int id) {

              case PIPE_ALGO_FEEDBACK:

                     LM_DBG("drop_rate [%d],hash[*pipes[id].counter][%d]\n",*drop_rate, hash[*pipes[id].counter]);

                     ret = (hash[*pipes[id].counter % 100] < *drop_rate) ? -1 : 1;

}

                We are not able to understand the above line (hash[*pipes[id].counter % 100]). Could you please elaborate.

 

6.       Where are we lagging ?

 

 

Regards,

Prashanth

               


============================================================================================================================
Disclaimer: This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahindra.com/Disclaimer.html externally http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra.
============================================================================================================================



_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users