title: Mongodb + PHP Failed to send "find" command with database "Czechia": Failed to read 4 bytes: socket error or timeout
body: <p>I have a PHP script which should send about 2 millions of items from MongoDB to Elasticsearch. There is a loop where one iteration needs to make 4 requests to the MongoDB where the query simply calls </p>
  
  <pre><code>{"ico": {$in: [here are 50 items]}}
  // collection has about 2M items and ico is indexed
  </code></pre>
  
  <p>But it still ends up on this error <strong>Failed to read 4 bytes: socket error or timeout</strong> - MongoDB version is 4, PHP version 7.1.</p>
  
  <p>What does that mean? Are 50 items with $in query too much if collection has about 2 million items? How to solve it?</p>