Giter VIP home page Giter VIP logo

Comments (2)

dubrovine avatar dubrovine commented on July 17, 2024

I guess the problem is here
"max_overflow_master": 100

mongoc:status(Atom) - indicating that overflow is growing

when I set "max_overflow_master" to 0 on the test server - it shows a better performance

from mongodb-erlang.

dubrovine avatar dubrovine commented on July 17, 2024

I am still having the same issue

always getting timeout on mongoc:get_pool
also having the same timeout with Redis connection timeout gen_server:call

seems like some sort of bottleneck

here is the mongo db connection part

start_pool(Config) ->
    ReplicaSet      = data:get(<<"rs">>, Config),
    Hosts           = data:get(<<"hosts">>, Config),
    Database        = data:get(<<"database">>, Config),
    Login           = data:get(<<"login">>, Config),
    Password        = data:get(<<"password">>, Config),
    PoolSizeMaster  = data:get(<<"pool_size_master">>, Config),
    Credentials     = case Login of undefined -> []; _ -> [{login, Login}, {password, Password}, {auth_source, Database}] end,
    {ok, _Pid} = mongoc:connect(
        {rs, ReplicaSet, Hosts},
        [
            {name, ?MONGO_MASTER}, 
            {register, ?MONGO_MASTER},
            {max_overflow, 0},
            {pool_size, PoolSizeMaster},
            {rp_mode, primary}
        ],
        [{database, Database} | Credentials]
    ),
    PoolSizeSlave  = data:get(<<"pool_size_slave">>, Config),
    {ok, _} = mongoc:connect(
        {rs, ReplicaSet, Hosts},
        [
            {name, ?MONGO_SLAVE}, 
            {register, ?MONGO_SLAVE}, 
            {pool_size, PoolSizeSlave}, 
            {max_overflow, 0},
            {rp_mode, secondaryPreferred}
        ],
        [{database, Database}, {r_mode, slave_ok} | Credentials]
    ),
    ok.

what am I doing wrong ?
thanx

from mongodb-erlang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.