maxPoolSize error

at the time of cluster creation i have used the user and password as “mongo”, i have changed as per suggestions. till code is not working

Hey @Madival_biradar,

Welcome to the MongoDB Community Forums! :leaves:

The discussion where you posted was more than three years old, hence created this new post for your problem.

Can you kindly post the error message you are getting, your .ini file contents as well as the code you tried? This will help in better understanding the problem you are facing.

Regards,
Satyam

1 Like

.ini

[PROD]
SECRET_KEY = super_secret_testing
MFLIX_DB_URI = mongodb+srv://mongo:mongo@mflix.qeltc.mongodb.net/test
MFLIX_NS = sample_mflix

[TEST]
SECRET_KEY = super_secret_testing_key
MFLIX_DB_URI = mongodb+srv://mongo:mongo@mflix.qeltc.mongodb.net/test
MFLIX_NS = sample_mflix

db.py

def get_db():

    """

    Configuration method to return db instance

    """

    db = getattr(g, "_database", None)

    MFLIX_DB_URI = current_app.config["MFLIX_DB_URI"]

    MFLIX_DB_NAME = current_app.config["MFLIX_NS"]

    if db is None:

        """

        Ticket: Connection Pooling

        Please change the configuration of the MongoClient object by setting the

        maximum connection pool size to 50 active connections.

        """

        """

        Ticket: Timeouts

        Please prevent the program from waiting indefinitely by setting the

        write concern timeout limit to 2500 milliseconds.

        """

        db = g._database = MongoClient(

        MFLIX_DB_URI,

        # TODO: Connection Pooling

        # Set the maximum connection pool size to 50 active connections.

        # TODO: Timeouts

        # Set the write timeout limit to 2500 milliseconds.

        maxPoolSize=50,

        wtimeout=2500

        )[MFLIX_DB_NAME] 

    return db

Hey @Madival_biradar,

The .ini file you sent still has the same “mongo” as username and password. Other than this, if you look at the documentation provided for this lab( Ticket: Timeouts ), you’ll notice it is not wtimeout. It should be wTimeoutMS.

Let us know if this helps. Please feel free to reach out for anything else as well.

Regards,
Satyam

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.