-
PHP + NGINX win for high concurrent connection performance than NodeJS. Is it possible? How it happened? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 15 replies
-
In reality the difference is bigger. Because the spectre/meldown/retbleed mitigations affected the Xeon Gold in the citrine servers. Php-ngx is not the normal PHP + Nginx, it's using ngx-php that is a PHP lib embedded in Nginx. When Nodejs use the database, drop drastically. Normal PHP with Nginx, using Fastcgi never will be faster than Nodejs in json and plaintext, but it's faster when using the database. And still I'll try to make it faster when normal php use the database. And in a real app, normally Nginx will be in front of Nodejs, as a Proxy server and drop a little more. |
Beta Was this translation helpful? Give feedback.
-
Not what I'm observing in real life though, PHP really feels faster for development, is more lightweight and simpler, which is probably why it's so much more popular than nodejs. Both have all the libraries they need to do more or less anything. |
Beta Was this translation helpful? Give feedback.
-
Currently, there is uWebsockets.js in NodeJS which can stand up against other popular framework. In that test, i use different database driver than the one used in this repository. |
Beta Was this translation helpful? Give feedback.
In reality the difference is bigger. Because the spectre/meldown/retbleed mitigations affected the Xeon Gold in the citrine servers.
And Nginx is very affected for that. We are waiting the new servers, with new CPUs.
Php-ngx is not the normal PHP + Nginx, it's using ngx-php that is a PHP lib embedded in Nginx.
The normal php with Nginx is at number 6, and now have only 9K req/s more than Nodejs. In round 18, before the mitigations, normal PHP was ~40K req/s faster than Nodejs.
When Nodejs use the database, drop drastically.
And Workerman (php from cli without server) or Ngx-php are a lot faster than Nodejs in all tests.
Normal PHP with Nginx, using Fastcgi never will be faster than Nodejs…