title: MongoDB Blacklisted Fatal Error
body: <p>I've seen this error a couple of times, and to fix it, I just reboot my server.</p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception 'MongoConnectionException' with
    message 'Failed to connect to: localhost:27017: Previous connection
    attempts failed, server blacklisted' in
    /var/www/html/include/config.php:9 Stack trace: #0
    /var/www/html/include/config.php(9):
    MongoClient->__construct('mongodb://local...') #1
    /var/www/html/classes.php(3): include('/var/www/html/i...') #2
    /var/www/html/myusers.php(8): include('/var/www/html/c...') #3 {main}
    thrown in /var/www/html/include/config.php on line 9</p>
  </blockquote>
  
  <p>However, I can be a while without seeing it... How can I prevent the issue from happening?</p>
  
  <p>update: it happened again and after several minutes of waiting, I had to reboot to make the site work again</p>