You wrote:
makes it do asynchronously when using PHP
Are you sure this is not possible? Not Even With Aszz Gambling Requests ?
In any case, I implemented the same REST API server in several languages โโand tested it on the same computer (Ubuntu Linux 16.04, Intel NUC i7, 16 GB RAM) and found:
(a source)
Please note that Node.js was the only platform that could not efficiently use multiple cores.
To simulate your requirements, I tried adding 15 ms to the first PHP and 15ms setTimeout to Node.js, and found that when you hit with 2000 simultaneous requests, Node.js was higher (4300 versus 1800 req / sec), but also higher latency (450 vs 130 ms / repeat). Probably because he used only one core and had to respond to many events. This higher latency with higher throughput can be caused by the use of an event loop. Using the Apache (pre) fork can be more expensive, but able to achieve higher concurrency.
Iโm not sure that all this will help you a lot directly, but it can give you a starting point for your own research. Enjoy!
source share