Thank you for the information. As a general rule, please copy terminal output and put it into a code block in the reply, this makes it easier for others to read it.
Please note that I can only comment toward the behaviour of the MongoDB extension. Connections to MongoDB are persisted internally per process. This means that if you invoke the script from the CLI, a new PHP process is spawned for every run, which will always create a new connection. That said, when the PHP process is terminated, the connection is closed, so you shouldn’t see a continuous increase in connections.
How is the code above invoked? Do you run it through the CLI (so one connection per process), or do you run it through a webserver to php-fpm or another SAPI?
1 Like