title: Best way to do asynchronous processing in PHP
body: <p>I need to build a system (in PHP) that does massive queries on MSSQL to retrieve the result as follows:</p>
  
  <p>I have 10 independent queries that I need to run when a user visits a page (some are massive). What is the most scalable solution to running 3 queries in parallel (7 in queue) and when a query is finished, run another from the queue?</p>
  
  <p>I need the page to load instantly, and as the query finishes, show the user the response of that query (the order is not so important).</p>
  
  <p>I took into consideration: AJAX, beanstalkd, NodeJS, libevent and Gearman or implement it as a web service in java (using threads and parallel processing).</p>
  
  <p>PS : I also found <code>AJAX PUSH ENGINE (APE - http://www.ape-project.org/)</code> and <code>xRML (http://www.xrtml.org/)</code> but never used it</p>