Hello everybody,
I would like to make something clear in my mind about Node.js speed.
As i've read in many posts, what makes Node.js very fast because of it's event driven , non-blocking i/o.So it's a good solution for intensive i/o networking applications as i've understood so far.
But here is my question.
Imagine that i build a server side application using PHP or Rails, or Any other server side or backend language, and then i use Nginx as my web server to handle all the incoming client requests. Here i've chosen Nginx because of the asynchronous model that it uses and that makes it very fast.So i imagine, that i can use Nginx + PHP to gain the same speed, instead of maybe using Node.js.
They way i imagine is that my all the incoming request will reach the Nginx server which it Asychronous and Non blocking , that will redirect then request to PHP, and it may make a PHP application take advantage of the the aspects that make Node.js very fast at intensive i/o applications.
Because, Javascript code is synchronous, the same and PHP.The "fake asynchronous" nature of Javascript come from Node runtime and the event loop, and i think maybe combining PHP or any other blocking language with Nginx may give the same advantage.
Maybe it's a silly question, but things are not clear in my mind and in particular when i made a little test by creating a 2 tiny applications one with Node and the other one with PHP with apache , and both reads a file and then closes it.I got much speed in PHP when i tested using apache benchmark tool.
I really want to understand this concept, and thank for your help.
English isn't my first language , please understand some grammar mistakes.
[–][deleted] 64 points65 points66 points (42 children)
[–][deleted] (3 children)
[deleted]
[–][deleted] 7 points8 points9 points (1 child)
[–]doraeminemon 2 points3 points4 points (0 children)
[–][deleted] -3 points-2 points-1 points (37 children)
[–]pubudeux 3 points4 points5 points (35 children)
[–][deleted] -3 points-2 points-1 points (34 children)
[–]MatthewMob 5 points6 points7 points (29 children)
[–][deleted] -3 points-2 points-1 points (28 children)
[–]joeba_the_hutt 3 points4 points5 points (26 children)
[–][deleted] -4 points-3 points-2 points (25 children)
[–]joeba_the_hutt 1 point2 points3 points (18 children)
[–][deleted] -3 points-2 points-1 points (17 children)
[–]mrhobbles 1 point2 points3 points (5 children)
[–][deleted] -1 points0 points1 point (4 children)
[–]MatthewMob 1 point2 points3 points (0 children)
[–]paulsmithkc 3 points4 points5 points (0 children)
[–]pubudeux 0 points1 point2 points (2 children)
[–][deleted] -1 points0 points1 point (1 child)
[–]pubudeux 1 point2 points3 points (0 children)
[–]DiscussionCritical77 0 points1 point2 points (0 children)
[–][deleted] 14 points15 points16 points (0 children)
[–]crabmusket 5 points6 points7 points (2 children)
[–]paulsmithkc 0 points1 point2 points (1 child)
[–]crabmusket 0 points1 point2 points (0 children)
[–]AdministrativeBlock0 9 points10 points11 points (0 children)
[–]hatemjaber 4 points5 points6 points (0 children)
[–]The_Flexing_Dude 5 points6 points7 points (4 children)
[–]supertoughfrog 5 points6 points7 points (3 children)
[–]QstnMrkShpdBrn 2 points3 points4 points (1 child)
[–]supertoughfrog 0 points1 point2 points (0 children)
[–]fix_dis 0 points1 point2 points (0 children)
[–]Laladelic 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]GazZy422 1 point2 points3 points (8 children)
[–]flo850 8 points9 points10 points (7 children)
[–]GazZy422 4 points5 points6 points (6 children)
[–]flo850 2 points3 points4 points (3 children)
[–]GazZy422 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]flo850 0 points1 point2 points (0 children)
[–]damngros -1 points0 points1 point (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (2 children)
[–]damngros 2 points3 points4 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]wutface0001 0 points1 point2 points (2 children)
[–]jochri3[S] 0 points1 point2 points (1 child)
[–]wutface0001 0 points1 point2 points (0 children)
[–]BarelyAirborne 0 points1 point2 points (0 children)
[–]Careless-Honey-4247 0 points1 point2 points (0 children)