title: Load test a Backbone App
body: <p>I've got an NGinx/Node/Express3/Socket.io/Redis/Backbone/Backbone.Marionette app that proxies requests to a PHP/MySQL REST API. I need to load test the entire stack as a whole.</p>
  
  <p>My app takes advantage of static asset caching with NGinx, clustering with node/express and socket is multi-core enabled using Redis. All that's to say, I've gone through a lot of trouble to try and make sure it can stand up to the load.</p>
  
  <p>I hit it with 50,000 users in 10 seconds using blitz.io and it didn't even blink... Which concerned me because I wanted to see it crash, or at least breath a little heavy; but 50k was the max you could throw at it with that tool, indicating to me that they expect you to not reasonably be able to, or need to, handle more than that... Which is when I realized it wasn't actually incurring the load I was expecting because the load is initiated after the page loads and the Backbone app starts up and kicks off the socket connection and requests the data from the correct REST API endpoint (from different server).</p>
  
  <p>So, here's my question:</p>
  
  <p><strong>How can I load test the entire app as a whole?</strong> I need the load test to tax the server in the same way that the clients actually will, which means:</p>
  
  <ol>
  <li>Request the single page Backbone app from my NGinx/Node/Express server</li>
  <li>Kick off requests for the static assets from NGinx (simulating what the browser would do)</li>
  <li>Kick off requests to the REST API (PHP/MySQL running on a different server)</li>
  <li>Create the connection to the Socket.io service (running on NGinx/Node/Express, utilizing Redis to handle multi-core junk)</li>
  </ol>
  
  <p>If the testing tool uses a browser-like environment to load the page up, parsing the JS and running it, everything will be copasetic (NGinx/Node/Express server will get hit and so will the PHP/MySQL server). Otherwise, the testing tool will need to simulate this by firing off at least a dozen different kinds of requests nearly simultaneously. Otherwise it's like stress testing a door by looking at it 10,000 times (that is to say, it's pointless).</p>
  
  <p>I need to ensure my app can handle 1,000 users hitting it in under a minute all loading the same page.</p>