title: Where to end the mysql pool connection on nodejs?
body: <p>I'm using MySQL on Nodejs. I'm using <code>mysql pool</code> to create the connection: </p>
  
  <pre><code>Var mysqk = require ('mysql');
  Var pool = mysql.createPool ({my configs});
  </code></pre>
  
  <p><strong>My question is:</strong>
  Where in the app will I use <code>pool.end()</code> as reported in the documentation?</p>
  
  <p>For example: in my <code>www</code> file, I created a code to release other things as I have pointed in de code. Should I use <code>pool.end()</code> there?</p>
  
  <pre><code>var app     = require('../app');
  var debug   = require('debug')('cancela:server');
  var http    = require('http');
  var port = normalizePort(process.env.PORT || '4000');
  app.set('port', port);
  var server = http.createServer(app);
  
  // my app codes...
  ..
  .
  .
  
  process.once('SIGTERM', end);
  process.once('SIGINT', end);
  
  function end() {
  
      server.close(function(err){
  
      if(err) throw err();
  
          // Should I end the Pool connection here?  &lt;&lt;&lt;&lt;&lt;&lt;===================================
          // pool.end(function (err) {
          //   // all connections in the pool have ended 
          // });
  
          console.log('Server endded!');        
  
          /* exit gracefully */
          process.exit();
      });
  }
  </code></pre>