I’ve just done 100,000 calls on api.test.php on my local web server and apache didn't crash. maybe you are having issues with Apache/nginx/PHP/FPM/DB configuration?
Unless you provide a more specific example it seems very hard to produce any meaningful advice/fix as I cannot replicate the issue.
"Jquery version try to trigger modules/Mobile/api.test.php a few times and the server will crash"
I've made a statement of fact: I wasn't able to crash my server with 100000 requests. Not sure how much more analytical can I be.
Maybe you should start describing the experienced issue more clearly?
"But, the point here is to have a rate limiter on the Webservices or to have a queueing mechanism."
DDOS attacks are mostly mitigated at firewall level not sure why would you have any limitation at app level.
having a rate limiter that would serve only configured no. of requests per minute
having a queue mechanism in place such that the requests are handled sequentially (or a defined no of requests at a given point of time, which could be configured)rather than starting a huge no. of processes at the same time, eventually exhausting the resources.
This would require no firewall for legit operations.