title: Apparently random 503 status code response of a REST service with Node.js
body: <p>I have a REST API developed by Node.js v8.9.4 with Hapi: </p>
  
  <pre><code>[GET] /api/v1/idds/:idd_id/item
  </code></pre>
  
  <p>the service execute a find on a mongoDB database: </p>
  
  <pre><code>function findOneWithItem(id, next) {this
  .findOneById(id)
  .populate('itemId')
  .exec(function(err, idds) {
    if (err) {
      console.error(chalk.bgRed.white(err));
      return next(boom.badImplementation());
    }
    if (!idds) {return next(boom.notFound(errors.code400.missingResource('Idd')));} return next(null, idds);});}
  </code></pre>
  
  <p>The application is deployed on a Ubuntu VM on AWS. 
  When the service is called the first time after some hours the log shows a response with an http status 503. After this firs call the service works fine again. We had the same problem with the application and the VM deployed on Azure. </p>
  
  <p>Which can be the reason? </p>