Skip to content

Connect to Mongo Atlas timeout happened sometimes with PHP library #855

@abinhho

Description

@abinhho

Description

Hello pro,

Im using PHP library and PHP 7.0.30, Mongo Atlas Free Tie and tried to connect, It's successful but looks too slow. I also connected via command line and it's worked as well. When using PHP, 10 times connection got 8 timeout, other times connected, get, insert, update data as normally.

This is my connection code:

$client = new \MongoDB\Client("mongodb://<USERNAME>:<PASSWORD>@mycluster0-shard-00-00-bez3z.gcp.mongodb.net:27017,mycluster0-shard-00-01-bez3z.gcp.mongodb.net:27017,mycluster0-shard-00-02-bez3z.gcp.mongodb.net:27017/test?ssl=true&replicaSet=MyCluster0-shard-0&authSource=admin&serverSelectionTryOnce=false&serverSelectionTimeoutMS=15000");

This is my timeout info:

MongoDB\Driver\Exception\ConnectionTimeoutException: No suitable servers found: `serverSelectionTimeoutMS` expired: [connection timeout calling ismaster on 'mycluster0-shard-00-00-bez3z.gcp.mongodb.net:27017'] [connection timeout calling ismaster on 'mycluster0-shard-00-01-bez3z.gcp.mongodb.net:27017'] [TLS handshake failed: -9806 calling ismaster on 'mycluster0-shard-00-02-bez3z.gcp.mongodb.net:27017'] in src/addons/HbinAws/vendor/mongodb/mongodb/src/Collection.php at line 262

Please help !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions