-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
php mongodb connect pool #688
Comments
The PHP driver uses libmongoc's single-threaded client mode, which does not implement connection pools. There is also no way to implement your own connection pooling using this driver. Each single-threaded libmongoc client object maintains at most one socket connection per Connection pools should not be needed for any single-threaded application, unless you're using an async PHP framework (e.g. Amp, ReactPHP). In those cases, you'd probably need to implement your own driver as we provide no way to integrate libmongoc's IO with a PHP event loop. Multi-threaded PHP applications (e.g. pthreads, forking) are not supported by the driver. |
The PHP driver uses libmongoc's single-threaded client mode, which does not implement connection pools. There is also no way to implement your own connection pooling using this driver. Each single-threaded libmongoc client object maintains at most one socket connection per mongod or mongos server. The relationship between MongoDB\Driver\Manager objects and libmongoc client objects is discussed in Connection Handling in the driver documentation. Connection pools should not be needed for any single-threaded application, unless you're using an async PHP framework (e.g. Amp, ReactPHP). In those cases, you'd probably need to implement your own driver as we provide no way to integrate libmongoc's IO with a PHP event loop. Multi-threaded PHP applications (e.g. pthreads, forking) are not supported by the driver. mongodb/mongo-php-driver#688 (comment)
doc : https://github.com/mongodb/mongo-php-driver/issues
mongodb doc: https://docs.mongodb.com/manual/reference/connection-string/#connection-pool-options
ask:
php mongodb default connection pool is 100, or 1 ?
How do I implement a connection pool in php?
The text was updated successfully, but these errors were encountered: