Hi,

That explains - during the execution of the startup route the rest of worker-like processes are not yet created (we wait to have the startup route finished), while the timer is already fires. So it triggers some timer jobs but there is no proc available to handle them.

This is a corner case, still I'm thinking of a solution on how to go around it. Still, at the end, there is nothing wrong (the timer jobs will still be handled, but later, after startup route is done), but you get those warnings.

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 01/24/2017 11:28 PM, Ahmed Munir wrote:
Yes, this works not to do DB op during route startup script and eliminate the warnings.


I would like to know, what method will you recommend for route startup DB op in opensips 2.2?

On Tue, Jan 24, 2017 at 9:12 AM, Bogdan-Andrei Iancu <bog...@opensips.org <mailto:bog...@opensips.org>> wrote:

    The versions before 2.1 had a completely different approach on hoe
    the timer jobs were handled - different code, so no such warnings.
    The 2.1 introduces the a more flexible and scalable processing for
    the timer jobs.

    Could you confirm that removing the DB op from the startup route
    eliminates the warnings ?

    Thanks,

    Bogdan-Andrei Iancu
    OpenSIPS Founder and Developer
    http://www.opensips-solutions.com <http://www.opensips-solutions.com>

    On 01/24/2017 03:49 PM, Ahmed Munir wrote:
    Yes, using startup route in my routing script and running DB
    query. This kind of warning I didn't face using 1.6 and 1.8
    opensips versions but 2.2.2.
    Will you recommend async statement for my current routing (see
below) for the startup? startup_route { $var(res) = 1; $avp(tmp) = "1"; # $var(x) = 0; while($var(res) > 0) {
            $var(res) = avp_db_query("SELECT Distinct One800, dnis
    FROM DNIS_Mapping where One800 > $avp(tmp) order by One800;",
    "$avp(One800), $avp(dnis)");         if($var(res) >= 0)         {
$var(i) = 0; while($(avp(One800)[$var(i)]) != "NULL") {
                            cache_store("local",
    "DNIS_$(avp(dnis)[$var(i)])", "$(avp(One800)[$var(i)])");
                            $avp(tmp) = $(avp(One800)[$var(i)]);
                     #       $var(x) = $var(x) + 1;
                            $(avp(One800)[$var(i)]) = "NULL";
$var(i) = $var(i) + 1; # xlog("$var(x) : $(avp(s:dnis)[$var(i)])");
                    }         }     } }
    On Tue, Jan 24, 2017 at 6:38 AM, Bogdan-Andrei Iancu
    <bog...@opensips.org <mailto:bog...@opensips.org>> wrote:

        Hi Ahmed, So, the warnings pop up ONLY during startup
        sequence.  Do you use startup route or any module performing
        mem caching of some DB table (drouting, permission, etc) ?
        Usually, the first UDP child is doing some heavy lifting
        during startup.Regards,

        Bogdan-Andrei Iancu
        OpenSIPS Founder and Developer
        http://www.opensips-solutions.com
        <http://www.opensips-solutions.com>

        On 01/19/2017 06:01 PM, Ahmed Munir wrote:
        Hi Razvan,
        During starting up the opensips service, I see the first
        opensips child process (pid"11172) consumes CPU process to
        70-80% and later drop downs to 0.3 - 0.0 % CPU per core. See
        below; [root@qorblpsisprxyd1 ~]# top -c -u opensips top -
        10:49:54 up 76 days, 23:31,  5 users,  load average: 0.00,
        0.00, 0.00 Tasks: 229 total,   1 running, 228 sleeping,   0
        stopped,   0 zombie Cpu(s):  0.0%us,  0.1%sy,  0.0%ni,
        99.9%id,  0.0%wa,  0.0%hi, 0.0%si,  0.0%st Mem:  65964364k
        total,  2568124k used, 63396240k free,   180220k buffers
Swap: 1023996k total, 0k used, 1023996k free, 1226104k cached PID USER PR NI VIRT RES SHR S
        %CPU %MEM    TIME+ COMMAND 11177 opensips  20   0  165m 5696
        4528 S  0.3  0.0   0:00.23 /usr/sbin/opensips -P
        /var/run/opensips.pid -m 64 -u opensips -g opensips 11187
        opensips  20   0  165m 5628 4460 S  0.3  0.0   0:00.41
        /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u
        opensips -g opensips 11166 opensips  20   0  165m 6892 5752
        S  0.0  0.0   0:00.23 /usr/sbin/opensips -P
        /var/run/opensips.pid -m 64 -u opensips -g opensips 11168
        opensips  20   0  165m 1980  840 S  0.0  0.0   0:00.00
        /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u
        opensips -g opensips 11169 opensips  20   0  165m 1464  328
        S  0.0  0.0   0:00.53 /usr/sbin/opensips -P
        /var/run/opensips.pid -m 64 -u opensips -g opensips 11171
        opensips  20   0  165m 1640  504 S  0.0  0.0   0:00.15
        /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u
        opensips -g opensips 11172 opensips  20   0  166m  40m  38m
        S  0.0  0.1   0:02.61 /usr/sbin/opensips -P
        /var/run/opensips.pid -m 64 -u opensips -g opensips 11174
        opensips  20   0  165m 6304 5136 S  0.0  0.0   0:00.24
        /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u
        opensips -g opensips 11175 opensips  20   0  165m 5884 4716
        S  0.0  0.0   0:00.22 /usr/sbin/opensips -P
        /var/run/opensips.pid -m 64 -u opensips -g opensips 11179
        opensips  20   0  165m 7660 6492 S  0.0  0.0   0:00.27
        /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u
        opensips -g opensips 11181 opensips  20   0  165m 7756 6588
        S  0.0  0.0   0:00.33 /usr/sbin/opensips -P
        /var/run/opensips.pid -m 64 -u opensips -g opensips 11183
        opensips  20   0  165m 5520 4352 S  0.0  0.0   0:00.34
        /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u
        opensips -g opensips 11185 opensips  20   0  165m 7336 6168
        S  0.0  0.0   0:00.36 /usr/sbin/opensips -P
        /var/run/opensips.pid -m 64 -u opensips -g opensips 11189
        opensips  20   0  165m 7320 6152 S  0.0  0.0   0:00.36
        /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u
        opensips -g opensips 11190 opensips  20   0  165m 4688 3528
        S  0.0  0.0   0:00.30 /usr/sbin/opensips -P
        /var/run/opensips.pid -m 64 -u opensips -g opensips
[root@qorblpsisprxyd1 ~]# opensipsctl fifo ps Process:: ID=0 PID=11166 Type=attendant Process:: ID=1 PID=11168
        Type=MI FIFO Process::  ID=2 PID=11169 Type=time_keeper
        Process::  ID=3 PID=11171 Type=timer Process::  ID=4
        PID=11172 Type=SIP receiver udp:10.3.120.94:5060
        <http://10.3.120.94:5060> Process::  ID=5 PID=11174 Type=SIP
        receiver udp:10.3.120.94:5060 <http://10.3.120.94:5060>
        Process::  ID=6 PID=11175 Type=SIP receiver
udp:10.3.120.94:5060 <http://10.3.120.94:5060> Process:: ID=7 PID=11177 Type=SIP receiver udp:10.3.120.94:5060
        <http://10.3.120.94:5060> Process::  ID=8 PID=11179 Type=SIP
        receiver udp:10.3.120.94:5060 <http://10.3.120.94:5060>
        Process::  ID=9 PID=11181 Type=SIP receiver
udp:10.3.120.94:5060 <http://10.3.120.94:5060> Process:: ID=10 PID=11183 Type=SIP receiver udp:10.3.120.94:5060
        <http://10.3.120.94:5060> Process::  ID=11 PID=11185
        Type=SIP receiver udp:10.3.120.94:5060
        <http://10.3.120.94:5060> Process::  ID=12 PID=11187
        Type=SIP receiver udp:10.3.120.94:5060
        <http://10.3.120.94:5060> Process::  ID=13 PID=11189
        Type=SIP receiver udp:10.3.120.94:5060
        <http://10.3.120.94:5060> Process::  ID=14 PID=11190
        Type=Timer handler OpenSIPs used by each CPU processor;
[root@qorblpsisprxyd1 ~]# ps -o pid,psr,comm -C opensips PID PSR COMMAND 11166 0 opensips 11168 2 opensips
        11169   6 opensips 11171   5 opensips 11172   5 opensips
        11174   5 opensips 11175   5 opensips 11177   5 opensips
        11179   7 opensips 11181   1 opensips 11183   0 opensips
        11185   2 opensips 11187   5 opensips 11189   5 opensips
        11190   4 opensips

-- Regards, Ahmed Munir Chohan

--
Regards, Ahmed Munir Chohan
_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to