Obviously there is some misunderstanding here! How would Nginx run without executing itself or its modules? :) I just tried to say it doesn't execute your web application, be it written in php, ruby, python, java or whatever.
Thanks for your reply anyway! On Wednesday, August 15, 2012 5:09:58 PM UTC+6, KRISHNA GUDA wrote: > > think I could clarify a few things here. Some of the > observations/assertions made are incorrect. Anyways, my 2 cents > (corrections & response). > > 1. nginx executes code. > > 2. In nginx you write async code all the time for the network and I/O. You > are writing them in C whereas in nodejs u write in js. Its generally > difficult to write async code in C. Whereas in js, functions are > first-class so aync code appears more elegant and needs lesser boilerplate. > Btw, you can only write code for modules or when implementing new network > I/O protocols in nginx. Most of the times you are just using the conf file > and occasionally you may have used some if-else construct which doesn't > mean that u write sync code nginx. > > 3. There could be some overlap in the objectives of nginx and nodejs but > they need not be compared. The good news is you can use nginx to serve > static content of nodejs web project. The stacks u mentioned are ok too. > > // Krishna > Sent from my BlackBerry > ------------------------------ > *From: * MHK <[email protected] <javascript:>> > *Sender: * [email protected] <javascript:> > *Date: *Wed, 15 Aug 2012 03:24:57 -0700 (PDT) > *To: *<[email protected] <javascript:>> > *ReplyTo: * [email protected] <javascript:> > *Subject: *[nodejs] Being both event-driven servers, why node.js needs > async code where Nginx doesn't? > > Being both event-driven servers, why node.js needs async code where Nginx > doesn't? In another words, if Nginx works as the same event-driven async IO > model of node, why doesn't it requires writing async style code? I know, > Nginx is *NOT* actually executing any code, rather proxying them to who > can. Then why doesn't node do so? Are we missing anything in the current > Ngninx way? Or, gaining anything more from node (apart from the pain of > writing async codes)? > > To be more specific, how different is Nginx+php-fpm or > Nginx+wsgi+python/ruby from node alone regarding performance or utilizing > computing resource that node claims? Couldn't node just use existing > FastCGI models, be a sync style JavaScript interpreter and let webserver do > its async job? > > PS. This question is cross-posted in > stackoverflow<http://stackoverflow.com/questions/11966292/being-both-event-driven-servers-why-node-js-needs-async-code-where-nginx-doesn> > . > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] <javascript:> > To unsubscribe from this group, send email to > [email protected] <javascript:> > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
