title: Node/Redis/Socket/pm2 Server closes connection after ~11 hours
body: <p>Having a problem with my node/nginx/redis/socket/pm2 server. It seems to just fail on an error that is being thrown by the mysql node package.</p>
  
  <p>PM2 is automatically restarting it now that I'm using <code>process.exit(0)</code> on <code>uncaughtException</code> and <code>SIGTERM</code>.</p>
  
  <p>The issue is still that it's dying for apparently no reason, the server isn't experiencing load, memory usage doesn't spike.</p>
  
  <p>I'm fairly lost right now, I've looked at other solutions and implemented a bunch of them last night but the error was still thrown this morning at 4am.</p>
  
  <p><code>
  "socket = 1 disconnect\n... user disconnected | Number of connections remaining: 1\n",
  </code></p>
  
  <p>Redis is showing two warnings on start up but my logs file is empty otherwise</p>
  
  <pre><code>    14718:M 06 Feb 17:57:38.107 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
  14718:M 06 Feb 17:57:38.107 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never &gt; /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
  </code></pre>
  
  <p>pm2 reports the following problem in it's logs:</p>
  
  <pre><code>Error: Connection lost: The server closed the connection.
  at Protocol.end (/usr/___/___/app/node_modules/mysql/lib/protocol/Protocol.js:109:13)
  at Socket.&lt;anonymous&gt; (/usr/___/___/app/node_modules/mysql/lib/Connection.js:109:28)
  at emitNone (events.js:91:20)
  at Socket.emit (events.js:185:7)
  at endReadableNT (_stream_readable.js:974:12)
  at _combinedTickCallback (internal/process/next_tick.js:74:11)
  at process._tickDomainCallback (internal/process/next_tick.js:122:9)
  </code></pre>