<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <tt>Hi Federico,<br>
      <br>
      Thanks for the info, good contribution. Unfortunately the DB conns
      are not the only issue here. When talking about 1200 processes,
      the overall memory, file descriptors and other may become a
      bottleneck too<br>
      <br>
      Best regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="moz-txt-link-freetext" href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
OpenSIPS Bootcamp 2020 online
  <a class="moz-txt-link-freetext" href="https://opensips.org/training/OpenSIPS_eBootcamp_2020/">https://opensips.org/training/OpenSIPS_eBootcamp_2020/</a></pre>
    <div class="moz-cite-prefix">On 11/3/20 4:39 PM, Federico Edorna
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAKi1vHg6dRafgSgYFpZS+Oq2_oA-PGPXg0jQJ9eEWjiUF+YCQw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">If it helps, we are using <a
            href="https://www.pgbouncer.org/" moz-do-not-send="true">pgbouncer</a> to
          avoid opening a lot of connections to db. Pgbouncer acts as a
          db server for opensips with full workers connections and opens
          just a few (on demand) to real db server. It helps a lot when
          you have backup/standby opensips, not increasing those db
          connections. <br>
          <br>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Tue, Nov 3, 2020 at 9:13
            AM Bogdan-Andrei Iancu <<a
              href="mailto:bogdan@opensips.org" moz-do-not-send="true">bogdan@opensips.org</a>>
            wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">Maybe we should consider
            (as future extension) the possibility to bundle <br>
            multiple UDP listeners on the same worker.  In this case, we
            can have a <br>
            large number of listeners with a relatively small number of
            workers/ <br>
            processes.<br>
            <br>
            Regards,<br>
            <br>
            Bogdan-Andrei Iancu<br>
            <br>
            OpenSIPS Founder and Developer<br>
               <a href="https://www.opensips-solutions.com"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://www.opensips-solutions.com</a><br>
            OpenSIPS Bootcamp 2020 online<br>
               <a
              href="https://opensips.org/training/OpenSIPS_eBootcamp_2020/"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://opensips.org/training/OpenSIPS_eBootcamp_2020/</a><br>
            <br>
            On 11/3/20 10:10 AM, Răzvan Crainea wrote:<br>
            > Hello!<br>
            ><br>
            > No, there is no way to prevent OpenSIPS from opening
            connections for <br>
            > each process. Did you try to start opensips with fewer
            workers, for <br>
            > example just 1, or 3? Does it start properly?<br>
            ><br>
            > Best regards,<br>
            ><br>
            > Răzvan Crainea<br>
            > OpenSIPS Core Developer<br>
            > <a href="http://www.opensips-solutions.com"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://www.opensips-solutions.com</a><br>
            ><br>
            > On 11/2/20 1:55 PM, M S wrote:<br>
            >> Thank you Bogdan. I actually use: socket=udp:*:5060
            in config file.<br>
            >> Is there a way to not open a process per interface,
            to not have 1200 <br>
            >> or 600 workers? as I said in my previous email, I
            tried auto scaling <br>
            >> and it didn't work.<br>
            >> Also, I have increased MySQL max connections but it
            didn't fix <br>
            >> the problem - I wonder if anybody has experience
            with this...<br>
            >><br>
            >> Thanks!<br>
            >><br>
            >> On Mon, Nov 2, 2020 at 9:24 AM Bogdan-Andrei Iancu
            <br>
            >> <<a href="mailto:bogdan@opensips.org"
              target="_blank" moz-do-not-send="true">bogdan@opensips.org</a>
            <mailto:<a href="mailto:bogdan@opensips.org"
              target="_blank" moz-do-not-send="true">bogdan@opensips.org</a>>>
            wrote:<br>
            >><br>
            >>     Hi OpenSIPer,<br>
            >><br>
            >>     With 600 interfaces (btw , have actually listed
            the 600 sockets into<br>
            >>     the cfg or pointed the socket to the
            interface?) with 2 workers per<br>
            >>     socket -> 1200 workers / processes. That
            means 1200 connections to<br>
            >>     your DB server, which may be a bottle neck (by
            default, mysql<br>
            >>     accepts around 100 simultaneous connections).<br>
            >><br>
            >>     I suspect your mysql server cannot cope with
            the 1200 conn,<br>
            >>     preventing OpenSIPS to properly start.<br>
            >><br>
            >>     Regards,<br>
            >><br>
            >>     Bogdan-Andrei Iancu<br>
            >><br>
            >>     OpenSIPS Founder and Developer<br>
            >>        <a
              href="https://www.opensips-solutions.com" rel="noreferrer"
              target="_blank" moz-do-not-send="true">https://www.opensips-solutions.com</a><br>
            >>     OpenSIPS Bootcamp 2020 online<br>
            >>        <a
              href="https://opensips.org/training/OpenSIPS_eBootcamp_2020/"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://opensips.org/training/OpenSIPS_eBootcamp_2020/</a><br>
            >><br>
            >>     On 11/2/20 1:23 AM, M S wrote:<br>
            >>>     Hi all,<br>
            >>>     I have a machine with 600 subinterfaces.
            when I start opensips<br>
            >>>     with 2 udp workers per interface, it
            doesn't start and keeps<br>
            >>>     restarting.<br>
            >>>     First error message was about too many
            connections to Mysql which<br>
            >>>     I fixed by increasing max_connections, but
            now I am getting:<br>
            >>><br>
            >>>     ERROR:db_mysql:db_mysql_new_connection:
            initial connect failed<br>
            >>>     ERROR:core:db_do_init: could not add
            connection to the pool<br>
            >>>     ERROR:sql_cacher:child_init: Cannot connect
            to SQL DB from child<br>
            >>>     ERROR:core:init_mod_child: failed to
            initializing module<br>
            >>>     sql_cacher, rank 683<br>
            >>>     ERROR:core:send_status_code: write(-1)
            failed (-1): 32, Broken pipe<br>
            >>>     ERROR:core:udp_start_processes: failed to
            send -1 status code<br>
            >>>     ERROR:db_mysql:db_mysql_connect: driver
            error(2002): Can't connect<br>
            >>>     to local MySQL server through socket
            '/var/lib/mysql/mysql.sock' <br>
            >>> (11)<br>
            >>><br>
            >>>     and:<br>
            >>><br>
            >>>     ERROR:core:send_status_code: write(-1)
            failed (-1): 32, Broken pipe<br>
            >>>     ERROR:core:udp_start_processes: failed to
            send -1 status code<br>
            >>><br>
            >>>     Any ideas how I can fix this?<br>
            >>>     Also, can I just limit number of opensips
            forked processes, to run<br>
            >>>     just a certain number process instead of x
            numbers per interface?<br>
            >>>     I tried using auto_scaling but it did not
            help. in my<br>
            >>>     opensips.conf, I have:<br>
            >>>     socket=udp:*:5060<br>
            >>>     and adding an autoscaling profile in front
            of it seems to limit<br>
            >>>     the processes per interface again, not
            all...<br>
            >>><br>
            >>>     Any help is appreciated.<br>
            >>><br>
            >>>     Thanks!<br>
            >>><br>
            >>>    
            _______________________________________________<br>
            >>>     Users mailing list<br>
            >>>     <a href="mailto:Users@lists.opensips.org"
              target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a>
            <mailto:<a href="mailto:Users@lists.opensips.org"
              target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a>><br>
            >>>     <a
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
            >><br>
            >><br>
            >> _______________________________________________<br>
            >> Users mailing list<br>
            >> <a href="mailto:Users@lists.opensips.org"
              target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a><br>
            >> <a
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
            >><br>
            ><br>
            > _______________________________________________<br>
            > Users mailing list<br>
            > <a href="mailto:Users@lists.opensips.org"
              target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a><br>
            > <a
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
            <br>
            <br>
            _______________________________________________<br>
            Users mailing list<br>
            <a href="mailto:Users@lists.opensips.org" target="_blank"
              moz-do-not-send="true">Users@lists.opensips.org</a><br>
            <a
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
          </blockquote>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>