[sr-dev] fork process during developing module

Mojtaba mespio at gmail.com
Thu Mar 14 10:18:10 CET 2019


Hi Henning,

If i want to choice daemon way, I will probably have some basic changes in
my code. As well, all data which are saved in shared_memory (or cache
memory) in Kamailio, should  be moved to it's daemon buffer, too. The
sounds looks like great but i should more sleep on it and take me more
times to do. Actually i am trying to complete ibefore Kamailio Conference.
Let's have some thinking...



On Thu, Mar 14, 2019 at 12:20 AM Henning Westerholt <hw at kamailio.org> wrote:

> Am Dienstag, 12. März 2019, 12:46:57 CET schrieb Mojtaba:
> > I just ask this question for more understanding during developing new
> > module in Kamailio,
> > A you know better than me, we could use register_procs and fork_process
> > functions to create new fork process in Kamailio project. I just did the
> > same things for first handover interface in hiops module. Finally you
> could
> > see list of all process with "kamctl ps" command.
> > I want to do the same things for third handover interface in hiops
> module,
> > But i think it would not be nice to see  a lot of list of process in
> > output! This conditions would be occurred if someone set the
> > hi3_worker_process parameter in hiops module to 100.
> > Am i right? Don't you think it is better to use nested fork process
> instead?
> > What do you think?
>
> Hi Mojtaba,
>
> normally you only need to fork one or two processes in a kamailio module,
> e.g.
> like for a dedicated timer process etc.. You should not fork many
> processes,
> as all of them will hold the configured PKG memory. Because of the multi-
> process architecture of Kamailio I would also not suggest to use a nested
> fork. Kamailio with its initialization structure (mod_init for the init
> before
> the fork, child_init for the init after the fork) was not designed for
> that in
> my opinion.
>
> If you see a need for one or many dedicated process(es) for e.g. handover
> interface handling, then I would suggest to use a dedicated separate
> daemon,
> like e.g. the sipcapture or rtpproxy/rtpengine modules. Kamailio could
> communicate over a socket or a similar interface with this daemon.
>
> Best regards,
>
> Henning
>
>
> --
> Henning Westerholt - https://skalatan.de/blog/
> Kamailio services - https://skalatan.de/services
> Kamailio security assessment - https://skalatan.de/de/assessment
>


-- 
--Mojtaba Esfandiari.S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20190314/0fc95d25/attachment-0001.html>


More information about the sr-dev mailing list