[OpenSIPS-Users] OpenSIPS 2.4.4, db_postgres.so number of connections

Bogdan-Andrei Iancu bogdan at opensips.org
Thu Mar 7 03:58:53 EST 2019


Hi Alexey,

Couple of notes on how the DB conns are handled in the OpenSIPS

1) each process has its own connections, even if to the same DB

2) if multiple modules need to connect to the same DB, from the same 
process, the conn is shared (between all modules using the same DB).

Now, depending on the exact opensips revision you have, you may run a 
version with a DB bug in clusterer module (this was fixed in the latest 
versions). Try removing the clusterer module and see if you have one 
connection per process per DB.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Summit 2019
   https://www.opensips.org/events/Summit-2019Amsterdam/

On 02/26/2019 09:47 AM, Alexey Kazantsev via Users wrote:
> Hi list!
>
> OpenSIPS 2.4.4 (x86_64/linux).
> CentOS 7.6.1810.
>
>     # we increased this value from default "2"
>     modparam("db_postgres", "max_db_queries", 20)
>     modparam("db_postgres", "exec_query_threshold", 60000)
>
>     modparam("acc",            "db_url", "postgres://user:PaSs@pg-server/db")
>     modparam("avpops",      "db_url", "postgres://user:PaSs@pg-server/db")
>     modparam("dispatcher", "db_url", "postgres://user:PaSs@pg-server/db")
>     modparam("clusterer",    "db_url", "postgres://user:PaSs@pg-server/db")
>
>
> My colleague noticed an interesting behavior with PG DB connection.
>
> 'netstat -tulpan | grep %pg-server-ip%' showed only 1 ESTABLISHED connection.
>
> When we configured 5432 port explicitly for the 'acc' module (which uses the DB
> most actively) ...
>
>     modparam("acc", "db_url", "postgres://user:PaSs@pg-server:5432/db")
>
> ... we saw several dozens of connections.
>
>
> And the load on the workers also decreased after that.
> Is it a bug?
>
>
> -----------------------------------------------
> BR, Alexey
> http://alexeyka.zantsev.com/
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users




More information about the Users mailing list