The last couple of days, my error log has been filled with this error:
send_package: error reading from socket: The socket is closed
I real
Increasing timeouts may help.
"connectTimeoutMS" : How long a connection can take to be opened before timing out in milliseconds.
$m = new MongoClient("mongodb://127.0.0.1:27017", array("connect"=>TRUE, "connectTimeoutMS"=>10, "socketTimeoutMS"=>10, "wTimeoutMS"=>10));
$db= $m->mydb;
$coll = $db->testData;
$coll->insert($paramArr);
There is a known issue with PHP/mongoclient + Apache + MongoDB where invalid persistent connections are held open by the Apache process.
Try to restart your Apache web server.
What happens is:
The only way to get past this issue is to restart Apache (forcing it to kill all of the worker threads and create new connections).
Let me know if this works for you.