title: Node.js Server Timeout Problems (EC2 + Express + PM2)
body: <p>I'm relatively new to running production node.js apps and I've recently been having problems with my server timing out.</p>
  
  <p>Basically after a certain amount of usage &amp; time my node.js app stops responding to requests. I don't even see routes being fired on my console anymore - it's like the whole thing just comes to a halt and the HTTP calls from my client (iPhone running AFNetworking) don't reach the server anymore. But if I restart my node.js app server everything starts working again, until things inevitable stop again. The app never crashes, it just stops responding to requests.</p>
  
  <p>I'm not getting any errors, and I've made sure to handle and log all DB connection errors so I'm not sure where to start. I thought it might have something to do with memory leaks so I installed <strong>node-memwatch</strong> and set up a listener for memory leaks but that doesn't get called before my server stops responding to requests.</p>
  
  <p>Any clue as to what might be happening and how I can solve this problem?</p>
  
  <p><strong>Here's my stack:</strong></p>
  
  <ul>
  <li>Node.js on AWS EC2 Micro Instance (using Express 4.0 + PM2)</li>
  <li>Database on AWS RDS volume running MySQL (using node-mysql)</li>
  <li>Sessions stored w/ Redis on same EC2 instance as the node.js app</li>
  <li>Clients are iPhones accessing the server via AFNetworking</li>
  </ul>
  
  <p>Once again no errors are firing with any of the modules mentioned above.</p>