Hi,
I have 2 kamailio servers behind a load balancer. How can I use t_suspend on one server and t_continue on the other one. I already have the index and label of the transaction saved in a common database shared by the two kamailio servers.
The reason I want to do this is for push notifications for iOS and Android, and I can't guarantee that the caller and the callee will register on the same server because of the load balancer.
Thanks Ahmed
The servers don't share transactions; just having the index and label stored in a shared DB isn't enough. What really has to be shared are the data structures and other metadata stored in the runtime instance of Kamailio.
So, you can't do that.
On 12/13/2014 04:14 AM, Ahmed Salem wrote:
Hi,
I have 2 kamailio servers behind a load balancer. How can I use t_suspend on one server and t_continue on the other one. I already have the index and label of the transaction saved in a common database shared by the two kamailio servers.
The reason I want to do this is for push notifications for iOS and Android, and I can't guarantee that the caller and the callee will register on the same server because of the load balancer.
Thanks Ahmed
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
Hi Alex,
Thanks for your reply. Is there any other way other than t_suspend/t_continue that I can use to scale kamailio and still support push notifications.
Thanks Ahmed
On Sat, Dec 13, 2014 at 6:57 PM, Alex Balashov abalashov@evaristesys.com wrote:
The servers don't share transactions; just having the index and label stored in a shared DB isn't enough. What really has to be shared are the data structures and other metadata stored in the runtime instance of Kamailio.
So, you can't do that.
On 12/13/2014 04:14 AM, Ahmed Salem wrote:
Hi,
I have 2 kamailio servers behind a load balancer. How can I use t_suspend on one server and t_continue on the other one. I already have the index and label of the transaction saved in a common database shared by the two kamailio servers.
The reason I want to do this is for push notifications for iOS and Android, and I can't guarantee that the caller and the callee will register on the same server because of the load balancer.
Thanks Ahmed
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
-- Alex Balashov - Principal Evariste Systems LLC 235 E Ponce de Leon Ave Suite 106 Decatur, GA 30030 United States
Tel: +1-678-954-0670 Web: http://www.evaristesys.com/, http://www.alexbalashov.com/
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
On 12/13/2014 12:33 PM, Ahmed Salem wrote:
Is there any other way other than t_suspend/t_continue that I can use to scale kamailio and still support push notifications.
Well, one factor is that Kamailio is very high-performant and scales very well in just one instance. Just how many clients do you have registered and how many messages per second do you want to process? Unless you're building an astronomically high-volume, national-scale service and realistically expect to have millions of endpoints, one Kamailio instance should probably be fine.
Failing that, there are a variety of ways to push messages to other Kamailio instances. The easiest generic way to send a message is using a synthetic request through uac_req_send():
http://kamailio.org/docs/modules/4.2.x/modules/uac.html#uac.f.uac_req_send()
You can receive it (and the arbitrary payload you have put in it) on the other server and do something with it.
You can also replicate requests using TM, if appropriate:
http://kamailio.org/docs/modules/4.2.x/modules/tm.html#tm.f.t_replicate
Also, some modules have started to use DMQ for distributing state:
http://kamailio.org/docs/modules/4.2.x/modules/dmq.html
-- Alex
Hi Alex, Thanks for your help. I think t_replicate is the best option for me. I expect about 300,000 to 400,000 end points and maybe 10% of them will send simultanoues requests per second, so will one instance still be enough? And what is the ratio between shared memory and available RAM if my machine is only dedicated to kamailio?
Thanks again for your quick and direct responses. Ahmed
On Sat, Dec 13, 2014 at 7:43 PM, Alex Balashov abalashov@evaristesys.com wrote:
On 12/13/2014 12:33 PM, Ahmed Salem wrote:
Is there any other way other than t_suspend/t_continue that I can use to
scale kamailio and still support push notifications.
Well, one factor is that Kamailio is very high-performant and scales very well in just one instance. Just how many clients do you have registered and how many messages per second do you want to process? Unless you're building an astronomically high-volume, national-scale service and realistically expect to have millions of endpoints, one Kamailio instance should probably be fine.
Failing that, there are a variety of ways to push messages to other Kamailio instances. The easiest generic way to send a message is using a synthetic request through uac_req_send():
http://kamailio.org/docs/modules/4.2.x/modules/uac. html#uac.f.uac_req_send()
You can receive it (and the arbitrary payload you have put in it) on the other server and do something with it.
You can also replicate requests using TM, if appropriate:
http://kamailio.org/docs/modules/4.2.x/modules/tm.html#tm.f.t_replicate
Also, some modules have started to use DMQ for distributing state:
http://kamailio.org/docs/modules/4.2.x/modules/dmq.html
-- Alex
-- Alex Balashov - Principal Evariste Systems LLC 235 E Ponce de Leon Ave Suite 106 Decatur, GA 30030 United States
Tel: +1-678-954-0670 Web: http://www.evaristesys.com/, http://www.alexbalashov.com/
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
On 12/13/2014 01:01 PM, Ahmed Salem wrote:
I expect about 300,000 to 400,000 end points and maybe 10% of them will send simultanoues requests per second, so will one instance still be enough?
It's hard to say due to the multitude of variables involved, but personally, I think you can do this off one instance.
And what is the ratio between shared memory and available RAM if my machine is only dedicated to kamailio?
You can probably dedicate most of your available RAM to Kamailio shared memory. Whether you should do that is hard to say. Kamailio doesn't need that much memory--even for hundreds of thousands of registered endpoints. A few gigabytes should do, to be on the safe side.