title: Php Long polling script consumes 20/20 number of processes on my premium shared hosting. How does it work?
body: <p>I have my page which make an Ajax call to my PHP script searching for data in the database. When I refresh the page multiple times consecutively, my host's number of processes limit on 20 reached (20/20). Because of that, no more php script can be executed until the processes number gets down in like 3 or more minutes. </p>
  
  <p>What's going on on the host when the page gets called and how to fix it? <em>Let's say if 30 people (even less) log on my website, my website will crash.</em></p>
  
  <p>Here is my script:</p>
  
  <pre><code>//Some logic code
  session_write_close();
  
  //It was 400
  set_time_limit(60);
  
  $genMesaj = false;
  
  do {
      sleep(5);
  
      //Some codes to search on the database
  
     //In case some data found
     \session_start();
     session_write_close();
  
      $genMesaj = //true or false;
  } while (!$genMesaj);
  </code></pre>