[OpenSIPS-Users] opensips locks if use db_virtual with few DB slaves and one slave becomes unavailable

Ben Newlin Ben.Newlin at genesys.com
Wed Aug 15 08:40:15 EDT 2018


We see this as well using db_virtual. The connections to postgres seem to take 10-15 minutes to timeout and try the next DB, which locks up a call processing thread. It doesn't take long for all threads to be blocked on the unreachable DB and OpenSIPS becomes essentially dead until all threads have timed out.

Ben Newlin 

On 8/15/18, 6:45 AM, "Users on behalf of kertor-f at yandex.ru" <users-bounces at lists.opensips.org on behalf of kertor-f at yandex.ru> wrote:

    Hello collegues! I have problem with module db_virtual.
    
    Configuration: I have two slave DB, opensips cottected to them over db_virtaul in ROUND mode:
    ########################################################################
    loadmodule "db_virtual.so"
    ########################################################################
    modparam("db_virtual", "db_urls", "define set1 ROUND")
    modparam("db_virtual", "db_urls", "postgres://psql:pass@10.0.0.1/opensips")
    modparam("db_virtual", "db_urls", "postgres://psql:pass@10.0.0.2/opensips")
    modparam("db_virtual", "db_max_consec_retrys", 3)
    ########################################################################
    If both DB in set1 is reacheble and works correctly, then opensips works correctly too.
    
    
    Problem: If i stops DB on one of both slaves (works with server), for example on 10.0.0.1, then opensips is locking. 
    I mean, DB on slave 10.0.0.1 becomes unreachable, but DB on slave 10.0.0.2 is works correctly and reacheble.
    I see big queues in opensips graph in zabbix.
    When i disable db_virtual and configure use of module db_postgres on reacheble 10.0.0.2, problem is gone.
    
    In docs i see:
    ROUND (round-robin)
    Use the next URL each time; if it fails, use the next one, redo operation.
    
    Can you help me to understand, is this correct behaviour of db_virtual?
    Maybe i need to use "failover" or "parralel" modes for resolve problem, then one of both bd slaves may be unreacheble?
    Thanks!
    
    opensips -V
    version: opensips 2.3.4 (x86_64/linux)
    flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, HP_MALLOC, FAST_LOCK-FUTEX-ADAPTIVE_WAIT
    ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
    poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
    git revision: c59e42e
    main.c compiled on 00:13:23 Jun 28 2018 with gcc 4.8.3
    
    _______________________________________________
    Users mailing list
    Users at lists.opensips.org
    http://lists.opensips.org/cgi-bin/mailman/listinfo/users
    



More information about the Users mailing list