title: Is there any way I could improve performance here?
body: <p>First off, if you read through my question description and feel that I have not provided enough information, please let me know and inform me on what would be helpful in providing:</p>
  
  <p>I'm using <a href="http://www.phantomjs.org/" rel="nofollow">PhantomJS</a>, a "headless" Webkit engine, to dynamically generate rather large images of ten websites within each web request. I'm currently using Ruby threads to run these processes in parallel (each "process" is the generation of an image for a single website, and so I have ten threads running for each web request). However, even when doing this, a single request (containing the ten threads running in parallel) tends to take up to two minutes on my local Webrick server, which is simply unacceptable to ask the user to bear.</p>
  
  <p>I'm definitely going to be moving these processes to a background task and then update the page with AJAX with the images so as not to tie up the web request and make the user experience better. However, I do not think that switching from threads to a background task (I'm thinking of using Resque) will actually shorten the time it takes to generate and display the images (I believe Resque can run its tasks in parallel so that I will not need threads?). </p>
  
  <p>So my question is how can I generate and display these images more quickly? I'd appreciate any advice, ranging from what servers or environments to run this on to what tools to use. I'm not tied to anything I'm currently using.</p>