title: Node.js: How to determine cause of server hangs
body: <p>I recently started noticing my Node.js app server hanging after a number of requests. After more investigation I narrowed it down to a specific endpoint. After about 30 hits on this endpoint, the server just stops responding and requests start timing out.</p>
  
  <p>In summary, on each request the clients upload a file, server does some preliminary checks, creates a new processing job, puts that on a queue, using <a href="https://www.npmjs.com/package/bull" rel="nofollow noreferrer">bull</a>, and returns a response to the client. The server then continues to process the job on the queue. The job process involves retrieving job data from a <code>Redis</code> database, clients opening WebSocket connections to check on job status, and server writing to the database once job is complete. I understand any one of those things could be causing the hang up.</p>
  
  <p>There are no errors or exceptions being thrown or logged. All I see is requests start to time out. I am using node-inspector to try to figure out what is causing the hang ups but not sure what to look for. </p>
  
  <p>My question is, is there a way to determine the root cause of hang up, using a debugger or some other means, to figure out too many <code>ABC</code> instances have been created, or too many <code>XYZ</code> connections are open.</p>