Re: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

2020-11-03 Thread mrsanvicente
Hi Ovidiu,

Thanks for taking the time for explaining.  I am sure some of us can take 
advantage of
It!

Mario San Vicente
Best regards

> El 3 nov 2020, a la(s) 22:51, Ovidiu Sas  escribió:
> 
> Hello Mario,
> 
> If you have CP working fine, you don't really need mi_html.
> If you want to have it as an alternative, load the module and set a
> new root path:
> modparam("mi_html", "root", "opensips_mi")
> Then you should be able to access the embedded management interface
> via http://[OPENSIPS_HTTPD_IP]:[OPENSIPS_HTTPD_PORT]/opensips_mi
> 
> This interface has nothing to do with CP. It's an alternative to
> opensipsctl, opensips-cli or CP (for dispatching management commands
> to opensips). The module was written to provide easy access to mi
> commands using a web browser (using the embedded web server from
> opensips - no need to use a dedicated web server).
> 
> The old name of the module was mi_http and was renamed to mi_html.
> The old mi_json was renamed to mi_http.
> No more mi_json, welcome mi_html and mi_http was "rebranded":
> mi_json [v<=2.4.x] -> mi_http [v>=3.0.x]
> mi_http [v<=2.4.x] -> mi_html [v>=3.0.x]
> This created some confusion when migrating from pre 2.4.x to post
> 3.0.x opensips versions.
> Clear as mud? :)
> 
> Hope this helps,
> Ovidiu
> 
>> On Tue, Nov 3, 2020 at 4:59 PM Mario San Vicente  
>> wrote:
>> 
>> Hello Răzvan /  Ovidiu,
>> 
>> After disabling mi_html, my CP is working fine, i will be enabling more 
>> modules on it.   Thanks for your help!
>> 
>> Ovidiu,   It would be good to have both portals running,but  i am not 
>> getting to work the following comment:
>> "If you want to keep mi_html, then set a different root path: 
>> #modparam("mi_html", "root", "osips_mi")  ", any other hint?
>> 
>> Thank you!
>> 
>> 
>> 
>> 
>> 
>>> On Tue, Nov 3, 2020 at 8:22 AM Ovidiu Sas  wrote:
>>> 
>>> Hello Mario,
>>> 
>>> It seems that you have both mi_http and mi_html modules loaded.
>>> By default, both modules have the root path set to mi and one of the
>>> modules is stealing the root path from the other.
>>> In your case, when you hit http://x.x.x.x:/mi , you are hitting a
>>> standalone management interface that is not part of opensips-cp. It's
>>> an alternative way to run mi commands through a web interface.
>>> 
>>> If you want to have only opensips-cp, then umload mi_html.
>>> If you want to keep mi_html, then set a different root path:
>>> #modparam("mi_html", "root", "osips_mi")
>>> 
>>> Hope this helps,
>>> Ovidiu
>>> 
>>> On Sat, Oct 31, 2020 at 1:58 PM Mario San Vicente
>>>  wrote:
 
 Hello  Răzvan ,
 I was wrong with my diagnosis, cause i stopped receiving the http / 400 
 error.  But when trying to monitor calls i see that the portal is not 
 reflecting the real info, i tested dialogs and rtpproxy.
 I do see the json reply on a trace, but it is not updated on the portal:
 
 T 127.0.0.1:47632 -> 127.0.0.1: [AP] #137
  POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
 application/json..Content-Length: 
 49{"jsonrpc":"2.0","id":1,"method":"rtpproxy_
  show"}"id..._";i#4
 #
 T 127.0.0.1: -> 127.0.0.1:47632 [A] #138
  ..._..k#)...
 #
 T 127.0.0.1: -> 127.0.0.1:47632 [AP] #139
  HTTP/1.1 200 OK..Content-Length: 136..Content-Type: 
 application/json..Date: Sat, 31 Oct 2020 17:34:22 
 GMT{"jsonrpc":"2.0","result":[{"Set":0,"Nodes
  
 ":[{"url":"udp:localhost:2123","index":0,"disabled":0,"weight":1,"recheck_ticks":0}]}],"id":1}.._..k#4
 
 T 127.0.0.1:47644 -> 127.0.0.1: [AP] #204
  POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
 application/json..Content-Length: 
 78{"jsonrpc":"2.0","id":1,"method":"dlg_list"
  ,"params":{"index":0,"counter":20}}._J.
 #
 T 127.0.0.1: -> 127.0.0.1:47644 [A] #205
  @.._
 #
 T 127.0.0.1: -> 127.0.0.1:47644 [AP] #206
  HTTP/1.1 200 OK..Content-Length: 58..Content-Type: 
 application/json..Date: Sat, 31 Oct 2020 17:42:14 
 GMT{"jsonrpc":"2.0","result":{"count":0,"Dialo
  gs":[]},"id":1}._4...4.
 
 Aside notes:
 When enabling this line #modparam("mi_http", "root", "opensips_mi") , i 
 can see the mi portal.  http://x.x.x.x:/mi , which has lots of 
 aditional info,  but i have to disable it to get the json response and 
 just get an http response pointing to the mi interface:
 T 127.0.0.1: -> 127.0.0.1:47654 [AP] #256
  HTTP/1.1 200 OK..Content-Length: 1886..Content-Type: text/html..Date: 
 Sat, 31 Oct 2020 17:55:45 GMTOpenSIPS Management 
 Interface
  >>> type="text/css">body{margin:0;}body,p,div,td,th,tr,form,ol,ul,li,input,textarea,select,a{font-family:"lucida
  grande",verdana,geneva,aria
  
 

Re: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

2020-11-03 Thread Ovidiu Sas
Hello Mario,

If you have CP working fine, you don't really need mi_html.
If you want to have it as an alternative, load the module and set a
new root path:
modparam("mi_html", "root", "opensips_mi")
Then you should be able to access the embedded management interface
via http://[OPENSIPS_HTTPD_IP]:[OPENSIPS_HTTPD_PORT]/opensips_mi

This interface has nothing to do with CP. It's an alternative to
opensipsctl, opensips-cli or CP (for dispatching management commands
to opensips). The module was written to provide easy access to mi
commands using a web browser (using the embedded web server from
opensips - no need to use a dedicated web server).

The old name of the module was mi_http and was renamed to mi_html.
The old mi_json was renamed to mi_http.
No more mi_json, welcome mi_html and mi_http was "rebranded":
mi_json [v<=2.4.x] -> mi_http [v>=3.0.x]
mi_http [v<=2.4.x] -> mi_html [v>=3.0.x]
This created some confusion when migrating from pre 2.4.x to post
3.0.x opensips versions.
Clear as mud? :)

Hope this helps,
Ovidiu

On Tue, Nov 3, 2020 at 4:59 PM Mario San Vicente  wrote:
>
> Hello Răzvan /  Ovidiu,
>
> After disabling mi_html, my CP is working fine, i will be enabling more 
> modules on it.   Thanks for your help!
>
> Ovidiu,   It would be good to have both portals running,but  i am not getting 
> to work the following comment:
> "If you want to keep mi_html, then set a different root path: 
> #modparam("mi_html", "root", "osips_mi")  ", any other hint?
>
> Thank you!
>
>
>
>
>
> On Tue, Nov 3, 2020 at 8:22 AM Ovidiu Sas  wrote:
>>
>> Hello Mario,
>>
>> It seems that you have both mi_http and mi_html modules loaded.
>> By default, both modules have the root path set to mi and one of the
>> modules is stealing the root path from the other.
>> In your case, when you hit http://x.x.x.x:/mi , you are hitting a
>> standalone management interface that is not part of opensips-cp. It's
>> an alternative way to run mi commands through a web interface.
>>
>> If you want to have only opensips-cp, then umload mi_html.
>> If you want to keep mi_html, then set a different root path:
>> #modparam("mi_html", "root", "osips_mi")
>>
>> Hope this helps,
>> Ovidiu
>>
>> On Sat, Oct 31, 2020 at 1:58 PM Mario San Vicente
>>  wrote:
>> >
>> > Hello  Răzvan ,
>> > I was wrong with my diagnosis, cause i stopped receiving the http / 400 
>> > error.  But when trying to monitor calls i see that the portal is not 
>> > reflecting the real info, i tested dialogs and rtpproxy.
>> > I do see the json reply on a trace, but it is not updated on the portal:
>> >
>> > T 127.0.0.1:47632 -> 127.0.0.1: [AP] #137
>> >   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
>> > application/json..Content-Length: 
>> > 49{"jsonrpc":"2.0","id":1,"method":"rtpproxy_
>> >   show"}"id..._";i#4
>> > #
>> > T 127.0.0.1: -> 127.0.0.1:47632 [A] #138
>> >   ..._..k#)...
>> > #
>> > T 127.0.0.1: -> 127.0.0.1:47632 [AP] #139
>> >   HTTP/1.1 200 OK..Content-Length: 136..Content-Type: 
>> > application/json..Date: Sat, 31 Oct 2020 17:34:22 
>> > GMT{"jsonrpc":"2.0","result":[{"Set":0,"Nodes
>> >   
>> > ":[{"url":"udp:localhost:2123","index":0,"disabled":0,"weight":1,"recheck_ticks":0}]}],"id":1}.._..k#4
>> > 
>> > T 127.0.0.1:47644 -> 127.0.0.1: [AP] #204
>> >   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
>> > application/json..Content-Length: 
>> > 78{"jsonrpc":"2.0","id":1,"method":"dlg_list"
>> >   ,"params":{"index":0,"counter":20}}._J.
>> > #
>> > T 127.0.0.1: -> 127.0.0.1:47644 [A] #205
>> >   @.._
>> > #
>> > T 127.0.0.1: -> 127.0.0.1:47644 [AP] #206
>> >   HTTP/1.1 200 OK..Content-Length: 58..Content-Type: 
>> > application/json..Date: Sat, 31 Oct 2020 17:42:14 
>> > GMT{"jsonrpc":"2.0","result":{"count":0,"Dialo
>> >   gs":[]},"id":1}._4...4.
>> >
>> > Aside notes:
>> > When enabling this line #modparam("mi_http", "root", "opensips_mi") , i 
>> > can see the mi portal.  http://x.x.x.x:/mi , which has lots of 
>> > aditional info,  but i have to disable it to get the json response and 
>> > just get an http response pointing to the mi interface:
>> > T 127.0.0.1: -> 127.0.0.1:47654 [AP] #256
>> >   HTTP/1.1 200 OK..Content-Length: 1886..Content-Type: text/html..Date: 
>> > Sat, 31 Oct 2020 17:55:45 GMTOpenSIPS Management 
>> > Interface
>> >   > > type="text/css">body{margin:0;}body,p,div,td,th,tr,form,ol,ul,li,input,textarea,select,a{font-family:"lucida
>> >  grande",verdana,geneva,aria
>> >   
>> > l,helvetica,sans-serif;font-size:14px;}a:hover{text-decoration:none;}a{text-decoration:underline;}.foot{padding-top:40px;font-size:10px;color:#33;}
>> >   .foot 
>> > a{font-size:10px;color:#00;}table.center{margin-left:auto;margin-right:auto;}> >  http-equiv="Expires" content="0">> >   "Pragma" content="no-cache">> > href="https://opensips.org/favicon.png;>.> > 

Re: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

2020-11-03 Thread Mario San Vicente
Hello Răzvan /  Ovidiu,

After disabling mi_html, my CP is working fine, i will be enabling more
modules on it.   Thanks for your help!

Ovidiu,   It would be good to have both portals running,but  i am not
getting to work the following comment:
"If you want to keep mi_html, then set a different root
path: #modparam("mi_html", "root", "osips_mi")  ", any other hint?

Thank you!





On Tue, Nov 3, 2020 at 8:22 AM Ovidiu Sas  wrote:

> Hello Mario,
>
> It seems that you have both mi_http and mi_html modules loaded.
> By default, both modules have the root path set to mi and one of the
> modules is stealing the root path from the other.
> In your case, when you hit http://x.x.x.x:/mi , you are hitting a
> standalone management interface that is not part of opensips-cp. It's
> an alternative way to run mi commands through a web interface.
>
> If you want to have only opensips-cp, then umload mi_html.
> If you want to keep mi_html, then set a different root path:
> #modparam("mi_html", "root", "osips_mi")
>
> Hope this helps,
> Ovidiu
>
> On Sat, Oct 31, 2020 at 1:58 PM Mario San Vicente
>  wrote:
> >
> > Hello  Răzvan ,
> > I was wrong with my diagnosis, cause i stopped receiving the http / 400
> error.  But when trying to monitor calls i see that the portal is not
> reflecting the real info, i tested dialogs and rtpproxy.
> > I do see the json reply on a trace, but it is not updated on the portal:
> >
> > T 127.0.0.1:47632 -> 127.0.0.1: [AP] #137
> >   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type:
> application/json..Content-Length:
> 49{"jsonrpc":"2.0","id":1,"method":"rtpproxy_
> >   show"}"id..._";i#4
> > #
> > T 127.0.0.1: -> 127.0.0.1:47632 [A] #138
> >   ..._..k#)...
> > #
> > T 127.0.0.1: -> 127.0.0.1:47632 [AP] #139
> >   HTTP/1.1 200 OK..Content-Length: 136..Content-Type:
> application/json..Date: Sat, 31 Oct 2020 17:34:22
> GMT{"jsonrpc":"2.0","result":[{"Set":0,"Nodes
> >
>  
> ":[{"url":"udp:localhost:2123","index":0,"disabled":0,"weight":1,"recheck_ticks":0}]}],"id":1}.._..k#4
> > 
> > T 127.0.0.1:47644 -> 127.0.0.1: [AP] #204
> >   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type:
> application/json..Content-Length:
> 78{"jsonrpc":"2.0","id":1,"method":"dlg_list"
> >   ,"params":{"index":0,"counter":20}}._J.
> > #
> > T 127.0.0.1: -> 127.0.0.1:47644 [A] #205
> >   @.._
> > #
> > T 127.0.0.1: -> 127.0.0.1:47644 [AP] #206
> >   HTTP/1.1 200 OK..Content-Length: 58..Content-Type:
> application/json..Date: Sat, 31 Oct 2020 17:42:14
> GMT{"jsonrpc":"2.0","result":{"count":0,"Dialo
> >   gs":[]},"id":1}._4...4.
> >
> > Aside notes:
> > When enabling this line #modparam("mi_http", "root", "opensips_mi") , i
> can see the mi portal.  http://x.x.x.x:/mi , which has lots of
> aditional info,  but i have to disable it to get the json response and just
> get an http response pointing to the mi interface:
> > T 127.0.0.1: -> 127.0.0.1:47654 [AP] #256
> >   HTTP/1.1 200 OK..Content-Length: 1886..Content-Type: text/html..Date:
> Sat, 31 Oct 2020 17:55:45 GMTOpenSIPS Management
> Interface
> >type="text/css">body{margin:0;}body,p,div,td,th,tr,form,ol,ul,li,input,textarea,select,a{font-family:"lucida
> grande",verdana,geneva,aria
> >
>  
> l,helvetica,sans-serif;font-size:14px;}a:hover{text-decoration:none;}a{text-decoration:underline;}.foot{padding-top:40px;font-size:10px;color:#33;}
> >   .foot
> a{font-size:10px;color:#00;}table.center{margin-left:auto;margin-right:auto;} http-equiv="Expires" content="0"> >   "Pragma" content="no-cache">https://opensips.org/favicon.png;>. bgcolor="#ff" l
> >   ink="#00" text="#00" vlink="#00"> cellpadding="5" width="100%%" border="0"> colspan=2 valign
> >   ="top" align="left" bgcolor="#EFF7FF" width="100%%"> align="center">OpenSIPS MI HTML InterfaceOpenSIPS
> (3.1.0-dev (x86_6
> >   4/linux)) is running since Sat Oct 31 11:55:35
> 2020.. cellpadding="3" cellspacing="0"> >   >.statistics. href='/mi/core'>core. href='/mi/blacklists'>blacklists.httpd.tm. href='/mi/usrloc'>usrloc. href='/mi/dialog'>dialog.nathelper. href='/mi/rtpproxy'>rtpproxy. href='/mi/db_text'>db_text.drouti
> >   ng class="foot" style="margin:20px auto"> style='margin-left:5px;'>OpenSIPS web siteCopyright 
> 2011-2015 http://www.voipembedded.com/;>VoIP Embedded, Inc..
> All rights res
> >   erved!.._X.t.4
> >
> > Thank in advace.
> >
> >
> > On Fri, Oct 30, 2020 at 8:45 PM Mario San Vicente <
> mrsanvice...@gmail.com> wrote:
> >>
> >> Hello  Răzvan ,
> >>
> >> Thanks alot, that made the trick.
> >>
> >> I will check if something is not matching with the monit page cause
> that is not working ,  but that's another story.
> >>
> >> Best regards.
> >> Mario
> >>
> >>
> >>
> >>
> >>
> >> On Thu, Oct 29, 2020 at 3:49 AM Răzvan Crainea 
> wrote:
> >>>
> >>> As I see in your logs, OpenSIPS CP uses the 

Re: [OpenSIPS-Users] multiple sub interfaces - opensips crashes

2020-11-03 Thread M S
thank you!

On Tue, Nov 3, 2020 at 8:15 PM Federico Edorna  wrote:

> I didn't read that it was mysql, sorry. I think my suggestion is for
> another thread :)
>
> Anyway, it seems that proxysql  can be a choice
> for mysql...
>
>
> On Tue, Nov 3, 2020 at 3:46 PM M S  wrote:
>
>> Thanks for the suggestion Federico. I'm using Myql, is there an
>> equivalent?
>>
>> On Tue, Nov 3, 2020 at 3:42 PM Federico Edorna 
>> wrote:
>>
>>> If it helps, we are using pgbouncer  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.
>>>
>>>
>>> On Tue, Nov 3, 2020 at 9:13 AM Bogdan-Andrei Iancu 
>>> wrote:
>>>
 Maybe we should consider (as future extension) the possibility to
 bundle
 multiple UDP listeners on the same worker.  In this case, we can have a
 large number of listeners with a relatively small number of workers/
 processes.

 Regards,

 Bogdan-Andrei Iancu

 OpenSIPS Founder and Developer
https://www.opensips-solutions.com
 OpenSIPS Bootcamp 2020 online
https://opensips.org/training/OpenSIPS_eBootcamp_2020/

 On 11/3/20 10:10 AM, Răzvan Crainea wrote:
 > Hello!
 >
 > No, there is no way to prevent OpenSIPS from opening connections for
 > each process. Did you try to start opensips with fewer workers, for
 > example just 1, or 3? Does it start properly?
 >
 > Best regards,
 >
 > Răzvan Crainea
 > OpenSIPS Core Developer
 > http://www.opensips-solutions.com
 >
 > On 11/2/20 1:55 PM, M S wrote:
 >> Thank you Bogdan. I actually use: socket=udp:*:5060 in config file.
 >> Is there a way to not open a process per interface, to not have 1200
 >> or 600 workers? as I said in my previous email, I tried auto scaling
 >> and it didn't work.
 >> Also, I have increased MySQL max connections but it didn't fix
 >> the problem - I wonder if anybody has experience with this...
 >>
 >> Thanks!
 >>
 >> On Mon, Nov 2, 2020 at 9:24 AM Bogdan-Andrei Iancu
 >> mailto:bog...@opensips.org>> wrote:
 >>
 >> Hi OpenSIPer,
 >>
 >> With 600 interfaces (btw , have actually listed the 600 sockets
 into
 >> the cfg or pointed the socket to the interface?) with 2 workers
 per
 >> socket -> 1200 workers / processes. That means 1200 connections
 to
 >> your DB server, which may be a bottle neck (by default, mysql
 >> accepts around 100 simultaneous connections).
 >>
 >> I suspect your mysql server cannot cope with the 1200 conn,
 >> preventing OpenSIPS to properly start.
 >>
 >> Regards,
 >>
 >> Bogdan-Andrei Iancu
 >>
 >> OpenSIPS Founder and Developer
 >>https://www.opensips-solutions.com
 >> OpenSIPS Bootcamp 2020 online
 >>https://opensips.org/training/OpenSIPS_eBootcamp_2020/
 >>
 >> On 11/2/20 1:23 AM, M S wrote:
 >>> Hi all,
 >>> I have a machine with 600 subinterfaces. when I start opensips
 >>> with 2 udp workers per interface, it doesn't start and keeps
 >>> restarting.
 >>> First error message was about too many connections to Mysql
 which
 >>> I fixed by increasing max_connections, but now I am getting:
 >>>
 >>> ERROR:db_mysql:db_mysql_new_connection: initial connect failed
 >>> ERROR:core:db_do_init: could not add connection to the pool
 >>> ERROR:sql_cacher:child_init: Cannot connect to SQL DB from child
 >>> ERROR:core:init_mod_child: failed to initializing module
 >>> sql_cacher, rank 683
 >>> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken
 pipe
 >>> ERROR:core:udp_start_processes: failed to send -1 status code
 >>> ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't
 connect
 >>> to local MySQL server through socket
 '/var/lib/mysql/mysql.sock'
 >>> (11)
 >>>
 >>> and:
 >>>
 >>> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken
 pipe
 >>> ERROR:core:udp_start_processes: failed to send -1 status code
 >>>
 >>> Any ideas how I can fix this?
 >>> Also, can I just limit number of opensips forked processes, to
 run
 >>> just a certain number process instead of x numbers per
 interface?
 >>> I tried using auto_scaling but it did not help. in my
 >>> opensips.conf, I have:
 >>> socket=udp:*:5060
 >>> and adding an autoscaling profile in front of it seems to limit
 >>> the processes per interface again, not all...
 >>>
 >>> Any help is 

Re: [OpenSIPS-Users] multiple sub interfaces - opensips crashes

2020-11-03 Thread Federico Edorna
I didn't read that it was mysql, sorry. I think my suggestion is for
another thread :)

Anyway, it seems that proxysql  can be a choice for
mysql...


On Tue, Nov 3, 2020 at 3:46 PM M S  wrote:

> Thanks for the suggestion Federico. I'm using Myql, is there an equivalent?
>
> On Tue, Nov 3, 2020 at 3:42 PM Federico Edorna 
> wrote:
>
>> If it helps, we are using pgbouncer  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.
>>
>>
>> On Tue, Nov 3, 2020 at 9:13 AM Bogdan-Andrei Iancu 
>> wrote:
>>
>>> Maybe we should consider (as future extension) the possibility to bundle
>>> multiple UDP listeners on the same worker.  In this case, we can have a
>>> large number of listeners with a relatively small number of workers/
>>> processes.
>>>
>>> Regards,
>>>
>>> Bogdan-Andrei Iancu
>>>
>>> OpenSIPS Founder and Developer
>>>https://www.opensips-solutions.com
>>> OpenSIPS Bootcamp 2020 online
>>>https://opensips.org/training/OpenSIPS_eBootcamp_2020/
>>>
>>> On 11/3/20 10:10 AM, Răzvan Crainea wrote:
>>> > Hello!
>>> >
>>> > No, there is no way to prevent OpenSIPS from opening connections for
>>> > each process. Did you try to start opensips with fewer workers, for
>>> > example just 1, or 3? Does it start properly?
>>> >
>>> > Best regards,
>>> >
>>> > Răzvan Crainea
>>> > OpenSIPS Core Developer
>>> > http://www.opensips-solutions.com
>>> >
>>> > On 11/2/20 1:55 PM, M S wrote:
>>> >> Thank you Bogdan. I actually use: socket=udp:*:5060 in config file.
>>> >> Is there a way to not open a process per interface, to not have 1200
>>> >> or 600 workers? as I said in my previous email, I tried auto scaling
>>> >> and it didn't work.
>>> >> Also, I have increased MySQL max connections but it didn't fix
>>> >> the problem - I wonder if anybody has experience with this...
>>> >>
>>> >> Thanks!
>>> >>
>>> >> On Mon, Nov 2, 2020 at 9:24 AM Bogdan-Andrei Iancu
>>> >> mailto:bog...@opensips.org>> wrote:
>>> >>
>>> >> Hi OpenSIPer,
>>> >>
>>> >> With 600 interfaces (btw , have actually listed the 600 sockets
>>> into
>>> >> the cfg or pointed the socket to the interface?) with 2 workers
>>> per
>>> >> socket -> 1200 workers / processes. That means 1200 connections to
>>> >> your DB server, which may be a bottle neck (by default, mysql
>>> >> accepts around 100 simultaneous connections).
>>> >>
>>> >> I suspect your mysql server cannot cope with the 1200 conn,
>>> >> preventing OpenSIPS to properly start.
>>> >>
>>> >> Regards,
>>> >>
>>> >> Bogdan-Andrei Iancu
>>> >>
>>> >> OpenSIPS Founder and Developer
>>> >>https://www.opensips-solutions.com
>>> >> OpenSIPS Bootcamp 2020 online
>>> >>https://opensips.org/training/OpenSIPS_eBootcamp_2020/
>>> >>
>>> >> On 11/2/20 1:23 AM, M S wrote:
>>> >>> Hi all,
>>> >>> I have a machine with 600 subinterfaces. when I start opensips
>>> >>> with 2 udp workers per interface, it doesn't start and keeps
>>> >>> restarting.
>>> >>> First error message was about too many connections to Mysql which
>>> >>> I fixed by increasing max_connections, but now I am getting:
>>> >>>
>>> >>> ERROR:db_mysql:db_mysql_new_connection: initial connect failed
>>> >>> ERROR:core:db_do_init: could not add connection to the pool
>>> >>> ERROR:sql_cacher:child_init: Cannot connect to SQL DB from child
>>> >>> ERROR:core:init_mod_child: failed to initializing module
>>> >>> sql_cacher, rank 683
>>> >>> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken
>>> pipe
>>> >>> ERROR:core:udp_start_processes: failed to send -1 status code
>>> >>> ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't
>>> connect
>>> >>> to local MySQL server through socket '/var/lib/mysql/mysql.sock'
>>> >>> (11)
>>> >>>
>>> >>> and:
>>> >>>
>>> >>> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken
>>> pipe
>>> >>> ERROR:core:udp_start_processes: failed to send -1 status code
>>> >>>
>>> >>> Any ideas how I can fix this?
>>> >>> Also, can I just limit number of opensips forked processes, to
>>> run
>>> >>> just a certain number process instead of x numbers per interface?
>>> >>> I tried using auto_scaling but it did not help. in my
>>> >>> opensips.conf, I have:
>>> >>> socket=udp:*:5060
>>> >>> and adding an autoscaling profile in front of it seems to limit
>>> >>> the processes per interface again, not all...
>>> >>>
>>> >>> Any help is appreciated.
>>> >>>
>>> >>> Thanks!
>>> >>>
>>> >>> ___
>>> >>> Users mailing list
>>> >>> Users@lists.opensips.org 
>>> >>> 

Re: [OpenSIPS-Users] multiple sub interfaces - opensips crashes

2020-11-03 Thread M S
That would be great if possible. or if you can expand auto_scaling to the
whole socket=udp:* group, not per IP...

On Tue, Nov 3, 2020 at 1:11 PM Bogdan-Andrei Iancu 
wrote:

> Maybe we should consider (as future extension) the possibility to bundle
> multiple UDP listeners on the same worker.  In this case, we can have a
> large number of listeners with a relatively small number of workers/
> processes.
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>https://www.opensips-solutions.com
> OpenSIPS Bootcamp 2020 online
>https://opensips.org/training/OpenSIPS_eBootcamp_2020/
>
> On 11/3/20 10:10 AM, Răzvan Crainea wrote:
> > Hello!
> >
> > No, there is no way to prevent OpenSIPS from opening connections for
> > each process. Did you try to start opensips with fewer workers, for
> > example just 1, or 3? Does it start properly?
> >
> > Best regards,
> >
> > Răzvan Crainea
> > OpenSIPS Core Developer
> > http://www.opensips-solutions.com
> >
> > On 11/2/20 1:55 PM, M S wrote:
> >> Thank you Bogdan. I actually use: socket=udp:*:5060 in config file.
> >> Is there a way to not open a process per interface, to not have 1200
> >> or 600 workers? as I said in my previous email, I tried auto scaling
> >> and it didn't work.
> >> Also, I have increased MySQL max connections but it didn't fix
> >> the problem - I wonder if anybody has experience with this...
> >>
> >> Thanks!
> >>
> >> On Mon, Nov 2, 2020 at 9:24 AM Bogdan-Andrei Iancu
> >> mailto:bog...@opensips.org>> wrote:
> >>
> >> Hi OpenSIPer,
> >>
> >> With 600 interfaces (btw , have actually listed the 600 sockets into
> >> the cfg or pointed the socket to the interface?) with 2 workers per
> >> socket -> 1200 workers / processes. That means 1200 connections to
> >> your DB server, which may be a bottle neck (by default, mysql
> >> accepts around 100 simultaneous connections).
> >>
> >> I suspect your mysql server cannot cope with the 1200 conn,
> >> preventing OpenSIPS to properly start.
> >>
> >> Regards,
> >>
> >> Bogdan-Andrei Iancu
> >>
> >> OpenSIPS Founder and Developer
> >>https://www.opensips-solutions.com
> >> OpenSIPS Bootcamp 2020 online
> >>https://opensips.org/training/OpenSIPS_eBootcamp_2020/
> >>
> >> On 11/2/20 1:23 AM, M S wrote:
> >>> Hi all,
> >>> I have a machine with 600 subinterfaces. when I start opensips
> >>> with 2 udp workers per interface, it doesn't start and keeps
> >>> restarting.
> >>> First error message was about too many connections to Mysql which
> >>> I fixed by increasing max_connections, but now I am getting:
> >>>
> >>> ERROR:db_mysql:db_mysql_new_connection: initial connect failed
> >>> ERROR:core:db_do_init: could not add connection to the pool
> >>> ERROR:sql_cacher:child_init: Cannot connect to SQL DB from child
> >>> ERROR:core:init_mod_child: failed to initializing module
> >>> sql_cacher, rank 683
> >>> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
> >>> ERROR:core:udp_start_processes: failed to send -1 status code
> >>> ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect
> >>> to local MySQL server through socket '/var/lib/mysql/mysql.sock'
> >>> (11)
> >>>
> >>> and:
> >>>
> >>> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
> >>> ERROR:core:udp_start_processes: failed to send -1 status code
> >>>
> >>> Any ideas how I can fix this?
> >>> Also, can I just limit number of opensips forked processes, to run
> >>> just a certain number process instead of x numbers per interface?
> >>> I tried using auto_scaling but it did not help. in my
> >>> opensips.conf, I have:
> >>> socket=udp:*:5060
> >>> and adding an autoscaling profile in front of it seems to limit
> >>> the processes per interface again, not all...
> >>>
> >>> Any help is appreciated.
> >>>
> >>> Thanks!
> >>>
> >>> ___
> >>> Users mailing list
> >>> Users@lists.opensips.org 
> >>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >>
> >>
> >> ___
> >> Users mailing list
> >> Users@lists.opensips.org
> >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >>
> >
> > ___
> > Users mailing list
> > Users@lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] multiple sub interfaces - opensips crashes

2020-11-03 Thread M S
Thanks for the suggestion Federico. I'm using Myql, is there an equivalent?

On Tue, Nov 3, 2020 at 3:42 PM Federico Edorna  wrote:

> If it helps, we are using pgbouncer  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.
>
>
> On Tue, Nov 3, 2020 at 9:13 AM Bogdan-Andrei Iancu 
> wrote:
>
>> Maybe we should consider (as future extension) the possibility to bundle
>> multiple UDP listeners on the same worker.  In this case, we can have a
>> large number of listeners with a relatively small number of workers/
>> processes.
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>>
>> OpenSIPS Founder and Developer
>>https://www.opensips-solutions.com
>> OpenSIPS Bootcamp 2020 online
>>https://opensips.org/training/OpenSIPS_eBootcamp_2020/
>>
>> On 11/3/20 10:10 AM, Răzvan Crainea wrote:
>> > Hello!
>> >
>> > No, there is no way to prevent OpenSIPS from opening connections for
>> > each process. Did you try to start opensips with fewer workers, for
>> > example just 1, or 3? Does it start properly?
>> >
>> > Best regards,
>> >
>> > Răzvan Crainea
>> > OpenSIPS Core Developer
>> > http://www.opensips-solutions.com
>> >
>> > On 11/2/20 1:55 PM, M S wrote:
>> >> Thank you Bogdan. I actually use: socket=udp:*:5060 in config file.
>> >> Is there a way to not open a process per interface, to not have 1200
>> >> or 600 workers? as I said in my previous email, I tried auto scaling
>> >> and it didn't work.
>> >> Also, I have increased MySQL max connections but it didn't fix
>> >> the problem - I wonder if anybody has experience with this...
>> >>
>> >> Thanks!
>> >>
>> >> On Mon, Nov 2, 2020 at 9:24 AM Bogdan-Andrei Iancu
>> >> mailto:bog...@opensips.org>> wrote:
>> >>
>> >> Hi OpenSIPer,
>> >>
>> >> With 600 interfaces (btw , have actually listed the 600 sockets
>> into
>> >> the cfg or pointed the socket to the interface?) with 2 workers per
>> >> socket -> 1200 workers / processes. That means 1200 connections to
>> >> your DB server, which may be a bottle neck (by default, mysql
>> >> accepts around 100 simultaneous connections).
>> >>
>> >> I suspect your mysql server cannot cope with the 1200 conn,
>> >> preventing OpenSIPS to properly start.
>> >>
>> >> Regards,
>> >>
>> >> Bogdan-Andrei Iancu
>> >>
>> >> OpenSIPS Founder and Developer
>> >>https://www.opensips-solutions.com
>> >> OpenSIPS Bootcamp 2020 online
>> >>https://opensips.org/training/OpenSIPS_eBootcamp_2020/
>> >>
>> >> On 11/2/20 1:23 AM, M S wrote:
>> >>> Hi all,
>> >>> I have a machine with 600 subinterfaces. when I start opensips
>> >>> with 2 udp workers per interface, it doesn't start and keeps
>> >>> restarting.
>> >>> First error message was about too many connections to Mysql which
>> >>> I fixed by increasing max_connections, but now I am getting:
>> >>>
>> >>> ERROR:db_mysql:db_mysql_new_connection: initial connect failed
>> >>> ERROR:core:db_do_init: could not add connection to the pool
>> >>> ERROR:sql_cacher:child_init: Cannot connect to SQL DB from child
>> >>> ERROR:core:init_mod_child: failed to initializing module
>> >>> sql_cacher, rank 683
>> >>> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken
>> pipe
>> >>> ERROR:core:udp_start_processes: failed to send -1 status code
>> >>> ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect
>> >>> to local MySQL server through socket '/var/lib/mysql/mysql.sock'
>> >>> (11)
>> >>>
>> >>> and:
>> >>>
>> >>> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken
>> pipe
>> >>> ERROR:core:udp_start_processes: failed to send -1 status code
>> >>>
>> >>> Any ideas how I can fix this?
>> >>> Also, can I just limit number of opensips forked processes, to run
>> >>> just a certain number process instead of x numbers per interface?
>> >>> I tried using auto_scaling but it did not help. in my
>> >>> opensips.conf, I have:
>> >>> socket=udp:*:5060
>> >>> and adding an autoscaling profile in front of it seems to limit
>> >>> the processes per interface again, not all...
>> >>>
>> >>> Any help is appreciated.
>> >>>
>> >>> Thanks!
>> >>>
>> >>> ___
>> >>> Users mailing list
>> >>> Users@lists.opensips.org 
>> >>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>> >>
>> >>
>> >> ___
>> >> Users mailing list
>> >> Users@lists.opensips.org
>> >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>> >>
>> >
>> > ___
>> > Users mailing list
>> > Users@lists.opensips.org

Re: [OpenSIPS-Users] multiple sub interfaces - opensips crashes

2020-11-03 Thread M S
Hi Razvan,
I tried, but it didn't start properly. I guess it is Mysql that returns an
error, but usually Opensips just prints a warning and continues running if
it cannot connect to database, right? I'm using Mysql for sql_cacher.
Is it possible that Opensips is running out of some other resources? I sent
the error messages I received in the original email...

Thanks!

On Tue, Nov 3, 2020 at 9:13 AM Răzvan Crainea  wrote:

> Hello!
>
> No, there is no way to prevent OpenSIPS from opening connections for
> each process. Did you try to start opensips with fewer workers, for
> example just 1, or 3? Does it start properly?
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Core Developer
> http://www.opensips-solutions.com
>
> On 11/2/20 1:55 PM, M S wrote:
> > Thank you Bogdan. I actually use: socket=udp:*:5060 in config file.
> > Is there a way to not open a process per interface, to not have 1200 or
> > 600 workers? as I said in my previous email, I tried auto scaling and it
> > didn't work.
> > Also, I have increased MySQL max connections but it didn't fix
> > the problem - I wonder if anybody has experience with this...
> >
> > Thanks!
> >
> > On Mon, Nov 2, 2020 at 9:24 AM Bogdan-Andrei Iancu  > > wrote:
> >
> > Hi OpenSIPer,
> >
> > With 600 interfaces (btw , have actually listed the 600 sockets into
> > the cfg or pointed the socket to the interface?) with 2 workers per
> > socket -> 1200 workers / processes. That means 1200 connections to
> > your DB server, which may be a bottle neck (by default, mysql
> > accepts around 100 simultaneous connections).
> >
> > I suspect your mysql server cannot cope with the 1200 conn,
> > preventing OpenSIPS to properly start.
> >
> > Regards,
> >
> > Bogdan-Andrei Iancu
> >
> > OpenSIPS Founder and Developer
> >https://www.opensips-solutions.com
> > OpenSIPS Bootcamp 2020 online
> >https://opensips.org/training/OpenSIPS_eBootcamp_2020/
> >
> > On 11/2/20 1:23 AM, M S wrote:
> >> Hi all,
> >> I have a machine with 600 subinterfaces. when I start opensips
> >> with 2 udp workers per interface, it doesn't start and keeps
> >> restarting.
> >> First error message was about too many connections to Mysql which
> >> I fixed by increasing max_connections, but now I am getting:
> >>
> >> ERROR:db_mysql:db_mysql_new_connection: initial connect failed
> >> ERROR:core:db_do_init: could not add connection to the pool
> >> ERROR:sql_cacher:child_init: Cannot connect to SQL DB from child
> >> ERROR:core:init_mod_child: failed to initializing module
> >> sql_cacher, rank 683
> >> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
> >> ERROR:core:udp_start_processes: failed to send -1 status code
> >> ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect
> >> to local MySQL server through socket '/var/lib/mysql/mysql.sock'
> (11)
> >>
> >> and:
> >>
> >> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
> >> ERROR:core:udp_start_processes: failed to send -1 status code
> >>
> >> Any ideas how I can fix this?
> >> Also, can I just limit number of opensips forked processes, to run
> >> just a certain number process instead of x numbers per interface?
> >> I tried using auto_scaling but it did not help. in my
> >> opensips.conf, I have:
> >> socket=udp:*:5060
> >> and adding an autoscaling profile in front of it seems to limit
> >> the processes per interface again, not all...
> >>
> >> Any help is appreciated.
> >>
> >> Thanks!
> >>
> >> ___
> >> Users mailing list
> >> Users@lists.opensips.org  
> >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >
> >
> > ___
> > Users mailing list
> > Users@lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] multiple sub interfaces - opensips crashes

2020-11-03 Thread Bogdan-Andrei Iancu

Hi Federico,

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


Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Bootcamp 2020 online
  https://opensips.org/training/OpenSIPS_eBootcamp_2020/

On 11/3/20 4:39 PM, Federico Edorna wrote:
If it helps, we are using pgbouncer  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.



On Tue, Nov 3, 2020 at 9:13 AM Bogdan-Andrei Iancu 
mailto:bog...@opensips.org>> wrote:


Maybe we should consider (as future extension) the possibility to
bundle
multiple UDP listeners on the same worker.  In this case, we can
have a
large number of listeners with a relatively small number of workers/
processes.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
https://www.opensips-solutions.com
OpenSIPS Bootcamp 2020 online
https://opensips.org/training/OpenSIPS_eBootcamp_2020/

On 11/3/20 10:10 AM, Răzvan Crainea wrote:
> Hello!
>
> No, there is no way to prevent OpenSIPS from opening connections
for
> each process. Did you try to start opensips with fewer workers, for
> example just 1, or 3? Does it start properly?
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Core Developer
> http://www.opensips-solutions.com
>
> On 11/2/20 1:55 PM, M S wrote:
>> Thank you Bogdan. I actually use: socket=udp:*:5060 in config file.
>> Is there a way to not open a process per interface, to not have
1200
>> or 600 workers? as I said in my previous email, I tried auto
scaling
>> and it didn't work.
>> Also, I have increased MySQL max connections but it didn't fix
>> the problem - I wonder if anybody has experience with this...
>>
>> Thanks!
>>
>> On Mon, Nov 2, 2020 at 9:24 AM Bogdan-Andrei Iancu
>> mailto:bog...@opensips.org>
>> wrote:
>>
>>     Hi OpenSIPer,
>>
>>     With 600 interfaces (btw , have actually listed the 600
sockets into
>>     the cfg or pointed the socket to the interface?) with 2
workers per
>>     socket -> 1200 workers / processes. That means 1200
connections to
>>     your DB server, which may be a bottle neck (by default, mysql
>>     accepts around 100 simultaneous connections).
>>
>>     I suspect your mysql server cannot cope with the 1200 conn,
>>     preventing OpenSIPS to properly start.
>>
>>     Regards,
>>
>>     Bogdan-Andrei Iancu
>>
>>     OpenSIPS Founder and Developer
>> https://www.opensips-solutions.com
>>     OpenSIPS Bootcamp 2020 online
>> https://opensips.org/training/OpenSIPS_eBootcamp_2020/
>>
>>     On 11/2/20 1:23 AM, M S wrote:
>>>     Hi all,
>>>     I have a machine with 600 subinterfaces. when I start opensips
>>>     with 2 udp workers per interface, it doesn't start and keeps
>>>     restarting.
>>>     First error message was about too many connections to
Mysql which
>>>     I fixed by increasing max_connections, but now I am getting:
>>>
>>>     ERROR:db_mysql:db_mysql_new_connection: initial connect failed
>>>     ERROR:core:db_do_init: could not add connection to the pool
>>>     ERROR:sql_cacher:child_init: Cannot connect to SQL DB from
child
>>>     ERROR:core:init_mod_child: failed to initializing module
>>>     sql_cacher, rank 683
>>>     ERROR:core:send_status_code: write(-1) failed (-1): 32,
Broken pipe
>>>     ERROR:core:udp_start_processes: failed to send -1 status code
>>>     ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't
connect
>>>     to local MySQL server through socket
'/var/lib/mysql/mysql.sock'
>>> (11)
>>>
>>>     and:
>>>
>>>     ERROR:core:send_status_code: write(-1) failed (-1): 32,
Broken pipe
>>>     ERROR:core:udp_start_processes: failed to send -1 status code
>>>
>>>     Any ideas how I can fix this?
>>>     Also, can I just limit number of opensips forked
processes, to run
>>>     just a certain number process instead of x numbers per
interface?
>>>     I tried using auto_scaling but it did not help. in my
>>>     opensips.conf, I have:
>>>     socket=udp:*:5060
>>>     and adding an autoscaling profile in front of it seems to
limit
>>>     the processes per interface again, not all...
>>>
>>>     Any help is appreciated.
>>>
>>>     Thanks!

Re: [OpenSIPS-Users] multiple sub interfaces - opensips crashes

2020-11-03 Thread Federico Edorna
If it helps, we are using pgbouncer  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.


On Tue, Nov 3, 2020 at 9:13 AM Bogdan-Andrei Iancu 
wrote:

> Maybe we should consider (as future extension) the possibility to bundle
> multiple UDP listeners on the same worker.  In this case, we can have a
> large number of listeners with a relatively small number of workers/
> processes.
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>https://www.opensips-solutions.com
> OpenSIPS Bootcamp 2020 online
>https://opensips.org/training/OpenSIPS_eBootcamp_2020/
>
> On 11/3/20 10:10 AM, Răzvan Crainea wrote:
> > Hello!
> >
> > No, there is no way to prevent OpenSIPS from opening connections for
> > each process. Did you try to start opensips with fewer workers, for
> > example just 1, or 3? Does it start properly?
> >
> > Best regards,
> >
> > Răzvan Crainea
> > OpenSIPS Core Developer
> > http://www.opensips-solutions.com
> >
> > On 11/2/20 1:55 PM, M S wrote:
> >> Thank you Bogdan. I actually use: socket=udp:*:5060 in config file.
> >> Is there a way to not open a process per interface, to not have 1200
> >> or 600 workers? as I said in my previous email, I tried auto scaling
> >> and it didn't work.
> >> Also, I have increased MySQL max connections but it didn't fix
> >> the problem - I wonder if anybody has experience with this...
> >>
> >> Thanks!
> >>
> >> On Mon, Nov 2, 2020 at 9:24 AM Bogdan-Andrei Iancu
> >> mailto:bog...@opensips.org>> wrote:
> >>
> >> Hi OpenSIPer,
> >>
> >> With 600 interfaces (btw , have actually listed the 600 sockets into
> >> the cfg or pointed the socket to the interface?) with 2 workers per
> >> socket -> 1200 workers / processes. That means 1200 connections to
> >> your DB server, which may be a bottle neck (by default, mysql
> >> accepts around 100 simultaneous connections).
> >>
> >> I suspect your mysql server cannot cope with the 1200 conn,
> >> preventing OpenSIPS to properly start.
> >>
> >> Regards,
> >>
> >> Bogdan-Andrei Iancu
> >>
> >> OpenSIPS Founder and Developer
> >>https://www.opensips-solutions.com
> >> OpenSIPS Bootcamp 2020 online
> >>https://opensips.org/training/OpenSIPS_eBootcamp_2020/
> >>
> >> On 11/2/20 1:23 AM, M S wrote:
> >>> Hi all,
> >>> I have a machine with 600 subinterfaces. when I start opensips
> >>> with 2 udp workers per interface, it doesn't start and keeps
> >>> restarting.
> >>> First error message was about too many connections to Mysql which
> >>> I fixed by increasing max_connections, but now I am getting:
> >>>
> >>> ERROR:db_mysql:db_mysql_new_connection: initial connect failed
> >>> ERROR:core:db_do_init: could not add connection to the pool
> >>> ERROR:sql_cacher:child_init: Cannot connect to SQL DB from child
> >>> ERROR:core:init_mod_child: failed to initializing module
> >>> sql_cacher, rank 683
> >>> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
> >>> ERROR:core:udp_start_processes: failed to send -1 status code
> >>> ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect
> >>> to local MySQL server through socket '/var/lib/mysql/mysql.sock'
> >>> (11)
> >>>
> >>> and:
> >>>
> >>> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
> >>> ERROR:core:udp_start_processes: failed to send -1 status code
> >>>
> >>> Any ideas how I can fix this?
> >>> Also, can I just limit number of opensips forked processes, to run
> >>> just a certain number process instead of x numbers per interface?
> >>> I tried using auto_scaling but it did not help. in my
> >>> opensips.conf, I have:
> >>> socket=udp:*:5060
> >>> and adding an autoscaling profile in front of it seems to limit
> >>> the processes per interface again, not all...
> >>>
> >>> Any help is appreciated.
> >>>
> >>> Thanks!
> >>>
> >>> ___
> >>> Users mailing list
> >>> Users@lists.opensips.org 
> >>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >>
> >>
> >> ___
> >> Users mailing list
> >> Users@lists.opensips.org
> >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >>
> >
> > ___
> > Users mailing list
> > Users@lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

Re: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

2020-11-03 Thread Ovidiu Sas
Hello Mario,

It seems that you have both mi_http and mi_html modules loaded.
By default, both modules have the root path set to mi and one of the
modules is stealing the root path from the other.
In your case, when you hit http://x.x.x.x:/mi , you are hitting a
standalone management interface that is not part of opensips-cp. It's
an alternative way to run mi commands through a web interface.

If you want to have only opensips-cp, then umload mi_html.
If you want to keep mi_html, then set a different root path:
#modparam("mi_html", "root", "osips_mi")

Hope this helps,
Ovidiu

On Sat, Oct 31, 2020 at 1:58 PM Mario San Vicente
 wrote:
>
> Hello  Răzvan ,
> I was wrong with my diagnosis, cause i stopped receiving the http / 400 
> error.  But when trying to monitor calls i see that the portal is not 
> reflecting the real info, i tested dialogs and rtpproxy.
> I do see the json reply on a trace, but it is not updated on the portal:
>
> T 127.0.0.1:47632 -> 127.0.0.1: [AP] #137
>   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
> application/json..Content-Length: 
> 49{"jsonrpc":"2.0","id":1,"method":"rtpproxy_
>   show"}"id..._";i#4
> #
> T 127.0.0.1: -> 127.0.0.1:47632 [A] #138
>   ..._..k#)...
> #
> T 127.0.0.1: -> 127.0.0.1:47632 [AP] #139
>   HTTP/1.1 200 OK..Content-Length: 136..Content-Type: application/json..Date: 
> Sat, 31 Oct 2020 17:34:22 GMT{"jsonrpc":"2.0","result":[{"Set":0,"Nodes
>   
> ":[{"url":"udp:localhost:2123","index":0,"disabled":0,"weight":1,"recheck_ticks":0}]}],"id":1}.._..k#4
> 
> T 127.0.0.1:47644 -> 127.0.0.1: [AP] #204
>   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
> application/json..Content-Length: 
> 78{"jsonrpc":"2.0","id":1,"method":"dlg_list"
>   ,"params":{"index":0,"counter":20}}._J.
> #
> T 127.0.0.1: -> 127.0.0.1:47644 [A] #205
>   @.._
> #
> T 127.0.0.1: -> 127.0.0.1:47644 [AP] #206
>   HTTP/1.1 200 OK..Content-Length: 58..Content-Type: application/json..Date: 
> Sat, 31 Oct 2020 17:42:14 GMT{"jsonrpc":"2.0","result":{"count":0,"Dialo
>   gs":[]},"id":1}._4...4.
>
> Aside notes:
> When enabling this line #modparam("mi_http", "root", "opensips_mi") , i can 
> see the mi portal.  http://x.x.x.x:/mi , which has lots of aditional 
> info,  but i have to disable it to get the json response and just get an http 
> response pointing to the mi interface:
> T 127.0.0.1: -> 127.0.0.1:47654 [AP] #256
>   HTTP/1.1 200 OK..Content-Length: 1886..Content-Type: text/html..Date: Sat, 
> 31 Oct 2020 17:55:45 GMTOpenSIPS Management Interface
>type="text/css">body{margin:0;}body,p,div,td,th,tr,form,ol,ul,li,input,textarea,select,a{font-family:"lucida
>  grande",verdana,geneva,aria
>   
> l,helvetica,sans-serif;font-size:14px;}a:hover{text-decoration:none;}a{text-decoration:underline;}.foot{padding-top:40px;font-size:10px;color:#33;}
>   .foot 
> a{font-size:10px;color:#00;}table.center{margin-left:auto;margin-right:auto;}  http-equiv="Expires" content="0">   "Pragma" content="no-cache"> href="https://opensips.org/favicon.png;>. bgcolor="#ff" l
>   ink="#00" text="#00" vlink="#00"> cellpadding="5" width="100%%" border="0"> valign
>   ="top" align="left" bgcolor="#EFF7FF" width="100%%"> align="center">OpenSIPS MI HTML InterfaceOpenSIPS 
> (3.1.0-dev (x86_6
>   4/linux)) is running since Sat Oct 31 11:55:35 
> 2020.. cellpadding="3" cellspacing="0">   >.statistics. href='/mi/core'>core. href='/mi/blacklists'>blacklists.httpd.tm. href='/mi/usrloc'>usrloc. href='/mi/dialog'>dialog.nathelper. href='/mi/rtpproxy'>rtpproxy. href='/mi/db_text'>db_text.drouti
>   ng class="foot" style="margin:20px auto"> style='margin-left:5px;'>OpenSIPS web siteCopyright  2011-2015  href="http://www.voipembedded.com/;>VoIP Embedded, Inc.. All rights res
>   erved!.._X.t.4
>
> Thank in advace.
>
>
> On Fri, Oct 30, 2020 at 8:45 PM Mario San Vicente  
> wrote:
>>
>> Hello  Răzvan ,
>>
>> Thanks alot, that made the trick.
>>
>> I will check if something is not matching with the monit page cause that is 
>> not working ,  but that's another story.
>>
>> Best regards.
>> Mario
>>
>>
>>
>>
>>
>> On Thu, Oct 29, 2020 at 3:49 AM Răzvan Crainea  wrote:
>>>
>>> As I see in your logs, OpenSIPS CP uses the `json` URL path for querying
>>> MI, whereas the default root path is `mi`[1]. Either change the `root`
>>> to `json`, or modify your OpenSIPS CP boxes config to `mi`.
>>>
>>> [1] https://opensips.org/docs/modules/3.1.x/mi_http.html#param_root
>>>
>>> Best regards,
>>>
>>> Răzvan Crainea
>>> OpenSIPS Core Developer
>>> http://www.opensips-solutions.com
>>>
>>> On 10/28/20 11:23 PM, Mario San Vicente wrote:
>>> >Thanks for the answer Johan,
>>> >
>>> > But i see that; the *mi_json* module has been renamed to
>>> > *mi_http* module.  and so: failed to load module mi_json.so
>>> > 

Re: [OpenSIPS-Users] multiple sub interfaces - opensips crashes

2020-11-03 Thread Bogdan-Andrei Iancu
Maybe we should consider (as future extension) the possibility to bundle 
multiple UDP listeners on the same worker.  In this case, we can have a 
large number of listeners with a relatively small number of workers/ 
processes.


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Bootcamp 2020 online
  https://opensips.org/training/OpenSIPS_eBootcamp_2020/

On 11/3/20 10:10 AM, Răzvan Crainea wrote:

Hello!

No, there is no way to prevent OpenSIPS from opening connections for 
each process. Did you try to start opensips with fewer workers, for 
example just 1, or 3? Does it start properly?


Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 11/2/20 1:55 PM, M S wrote:

Thank you Bogdan. I actually use: socket=udp:*:5060 in config file.
Is there a way to not open a process per interface, to not have 1200 
or 600 workers? as I said in my previous email, I tried auto scaling 
and it didn't work.
Also, I have increased MySQL max connections but it didn't fix 
the problem - I wonder if anybody has experience with this...


Thanks!

On Mon, Nov 2, 2020 at 9:24 AM Bogdan-Andrei Iancu 
mailto:bog...@opensips.org>> wrote:


    Hi OpenSIPer,

    With 600 interfaces (btw , have actually listed the 600 sockets into
    the cfg or pointed the socket to the interface?) with 2 workers per
    socket -> 1200 workers / processes. That means 1200 connections to
    your DB server, which may be a bottle neck (by default, mysql
    accepts around 100 simultaneous connections).

    I suspect your mysql server cannot cope with the 1200 conn,
    preventing OpenSIPS to properly start.

    Regards,

    Bogdan-Andrei Iancu

    OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
    OpenSIPS Bootcamp 2020 online
   https://opensips.org/training/OpenSIPS_eBootcamp_2020/

    On 11/2/20 1:23 AM, M S wrote:

    Hi all,
    I have a machine with 600 subinterfaces. when I start opensips
    with 2 udp workers per interface, it doesn't start and keeps
    restarting.
    First error message was about too many connections to Mysql which
    I fixed by increasing max_connections, but now I am getting:

    ERROR:db_mysql:db_mysql_new_connection: initial connect failed
    ERROR:core:db_do_init: could not add connection to the pool
    ERROR:sql_cacher:child_init: Cannot connect to SQL DB from child
    ERROR:core:init_mod_child: failed to initializing module
    sql_cacher, rank 683
    ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
    ERROR:core:udp_start_processes: failed to send -1 status code
    ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect
    to local MySQL server through socket '/var/lib/mysql/mysql.sock' 
(11)


    and:

    ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
    ERROR:core:udp_start_processes: failed to send -1 status code

    Any ideas how I can fix this?
    Also, can I just limit number of opensips forked processes, to run
    just a certain number process instead of x numbers per interface?
    I tried using auto_scaling but it did not help. in my
    opensips.conf, I have:
    socket=udp:*:5060
    and adding an autoscaling profile in front of it seems to limit
    the processes per interface again, not all...

    Any help is appreciated.

    Thanks!

    ___
    Users mailing list
    Users@lists.opensips.org 
    http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

2020-11-03 Thread Răzvan Crainea
I am not sure why you're saying it is not reflecting the real info - I 
can see the MI returning data for rtpproxy, are you sure that's not 
correct? And you're probably not having any ongoing calls, that's why 
dlg_list returns 0.
Running MI HTTP is a completely different story, what you're showing us 
is probably the output of the `which` command, enclosed in HTTP tags; 
you should try to run the `which` command as well through the CP, to 
have a comparison ground.

But I believe your setup is OK now.

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 10/31/20 7:57 PM, Mario San Vicente wrote:

Hello Răzvan ,
I was wrong with my diagnosis, cause i stopped receiving the http / 400 
error.  But when trying to monitor calls i see that the portal is not 
reflecting the real info, i tested dialogs and rtpproxy.

I do see the json reply on a trace, but it is not updated on the portal:

T 127.0.0.1:47632  -> 127.0.0.1: 
 [AP] #137
   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
application/json..Content-Length: 
49{"jsonrpc":"2.0","id":1,"method":"rtpproxy_

   show"}"id..._";i#4
#
T 127.0.0.1:  -> 127.0.0.1:47632 
 [A] #138

   ..._..k#)...
#
T 127.0.0.1:  -> 127.0.0.1:47632 
 [AP] #139
   HTTP/1.1 200 OK..Content-Length: 136..Content-Type: 
application/json..Date: Sat, 31 Oct 2020 17:34:22 
GMT{"jsonrpc":"2.0","result":[{"Set":0,"Nodes
   
":[{"url":"udp:localhost:2123","index":0,"disabled":0,"weight":1,"recheck_ticks":0}]}],"id":1}.._..k#4


T 127.0.0.1:47644  -> 127.0.0.1: 
 [AP] #204
   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
application/json..Content-Length: 
78{"jsonrpc":"2.0","id":1,"method":"dlg_list"

   ,"params":{"index":0,"counter":20}}._J.
#
T 127.0.0.1:  -> 127.0.0.1:47644 
 [A] #205

   @.._
#
T 127.0.0.1:  -> 127.0.0.1:47644 
 [AP] #206
   HTTP/1.1 200 OK..Content-Length: 58..Content-Type: 
application/json..Date: Sat, 31 Oct 2020 17:42:14 
GMT{"jsonrpc":"2.0","result":{"count":0,"Dialo

   gs":[]},"id":1}._4...4.

Aside notes:
When enabling this line #modparam("mi_http", "root", "opensips_mi") , i 
can see the mi portal. http://x.x.x.x:/mi , which has lots of 
aditional info,  but i have to disable it to get the json response and 
just get an http response pointing to the mi interface:
T 127.0.0.1:  -> 127.0.0.1:47654 
 [AP] #256
   HTTP/1.1 200 OK..Content-Length: 1886..Content-Type: text/html..Date: 
Sat, 31 Oct 2020 17:55:45 GMTOpenSIPS Management 
Interface
   type="text/css">body{margin:0;}body,p,div,td,th,tr,form,ol,ul,li,input,textarea,select,a{font-family:"lucida 
grande",verdana,geneva,aria
   
l,helvetica,sans-serif;font-size:14px;}a:hover{text-decoration:none;}a{text-decoration:underline;}.foot{padding-top:40px;font-size:10px;color:#33;}
   .foot 
a{font-size:10px;color:#00;}table.center{margin-left:auto;margin-right:auto;}http-equiv="Expires" content="0">   "Pragma" content="no-cache">href="https://opensips.org/favicon.png;>.bgcolor="#ff" l
   ink="#00" text="#00" vlink="#00">cellpadding="5" width="100%%" border="0">colspan=2 valign
   ="top" align="left" bgcolor="#EFF7FF" width="100%%">align="center">OpenSIPS MI HTML InterfaceOpenSIPS 
(3.1.0-dev (x86_6
   4/linux)) is running since Sat Oct 31 11:55:35 
2020..cellpadding="3" cellspacing="0">   >.statistics.href='/mi/core'>core.href='/mi/blacklists'>blacklists.httpd.tm.href='/mi/usrloc'>usrloc.href='/mi/dialog'>dialog.nathelper.href='/mi/rtpproxy'>rtpproxy.href='/mi/db_text'>db_text.drouti
   ngclass="foot" style="margin:20px auto">style='margin-left:5px;'>http://opensips.org>">OpenSIPS web 
siteCopyright  2011-2015 href="http://www.voipembedded.com/;>VoIP Embedded, Inc.. All rights res

   erved!.._X.t.4

Thank in advace.


On Fri, Oct 30, 2020 at 8:45 PM Mario San Vicente 
mailto:mrsanvice...@gmail.com>> wrote:


Hello Răzvan ,

Thanks alot, that made the trick.

I will check if something is not matching with the monit page cause
that is not working ,  but that's another story.

Best regards.
Mario




On Thu, Oct 29, 2020 at 3:49 AM Răzvan Crainea mailto:raz...@opensips.org>> wrote:

As I see in your logs, OpenSIPS CP uses the `json` URL path for
querying
MI, whereas the default root path is `mi`[1]. Either change the
`root`
to `json`, or modify your OpenSIPS CP boxes config to `mi`.

[1] 

Re: [OpenSIPS-Users] multiple sub interfaces - opensips crashes


Hello!

No, there is no way to prevent OpenSIPS from opening connections for 
each process. Did you try to start opensips with fewer workers, for 
example just 1, or 3? Does it start properly?


Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 11/2/20 1:55 PM, M S wrote:

Thank you Bogdan. I actually use: socket=udp:*:5060 in config file.
Is there a way to not open a process per interface, to not have 1200 or 
600 workers? as I said in my previous email, I tried auto scaling and it 
didn't work.
Also, I have increased MySQL max connections but it didn't fix 
the problem - I wonder if anybody has experience with this...


Thanks!

On Mon, Nov 2, 2020 at 9:24 AM Bogdan-Andrei Iancu > wrote:


Hi OpenSIPer,

With 600 interfaces (btw , have actually listed the 600 sockets into
the cfg or pointed the socket to the interface?) with 2 workers per
socket -> 1200 workers / processes. That means 1200 connections to
your DB server, which may be a bottle neck (by default, mysql
accepts around 100 simultaneous connections).

I suspect your mysql server cannot cope with the 1200 conn,
preventing OpenSIPS to properly start.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Bootcamp 2020 online
   https://opensips.org/training/OpenSIPS_eBootcamp_2020/

On 11/2/20 1:23 AM, M S wrote:

Hi all,
I have a machine with 600 subinterfaces. when I start opensips
with 2 udp workers per interface, it doesn't start and keeps
restarting.
First error message was about too many connections to Mysql which
I fixed by increasing max_connections, but now I am getting:

ERROR:db_mysql:db_mysql_new_connection: initial connect failed
ERROR:core:db_do_init: could not add connection to the pool
ERROR:sql_cacher:child_init: Cannot connect to SQL DB from child
ERROR:core:init_mod_child: failed to initializing module
sql_cacher, rank 683
ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
ERROR:core:udp_start_processes: failed to send -1 status code
ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect
to local MySQL server through socket '/var/lib/mysql/mysql.sock' (11)

and:

ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
ERROR:core:udp_start_processes: failed to send -1 status code

Any ideas how I can fix this?
Also, can I just limit number of opensips forked processes, to run
just a certain number process instead of x numbers per interface?
I tried using auto_scaling but it did not help. in my
opensips.conf, I have:
socket=udp:*:5060
and adding an autoscaling profile in front of it seems to limit
the processes per interface again, not all...

Any help is appreciated.

Thanks!

___
Users mailing list
Users@lists.opensips.org  
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users