I’m using apache 2 and the code above is running every time the user hits a page that requires a Mongo connection. i.e. GET https://app.xyz/customers.php. Then that page is using (new MongoDB\Client)->customers; and if I refresh the page Mongo will open another connection without closing the previous one.