title: PHP Limit total external API requests to 8 times per second
body: <p>My website has a script that will call an external API when a user visits a particular page.
  An API request will be made when the page is accessed and a response is returned in xml format.<br>
  I am using the usual curl requests.</p>
  
  <p>Right now, due to new implementations on the API side, if the API is getting too much requests, it will throw an exception and deny the request.<br>
  I want to limit the total calls to the API from my website to only 8 times per second.</p>
  
  <p>How can I achieve this? Someone suggested me about queuing the requests but I've never done something like this before and I'm having a hard time finding a solution.<br>
  Sorry if my English has errors. Any help is appreciated.</p>
  
  <p>For example: if 100 users accessed the web-page all at the same time, I need to queue those API requests 8 after 8 per second and so on until all are done.</p>