에몽이

What are the disadvantages of using Node.js for handling static resources? 본문

Backend/web server

What are the disadvantages of using Node.js for handling static resources?

ian_hodge 2017. 3. 3. 18:08

In terms of performance, conventional web servers like Apache/Nginx use as system call called sendfile(2), which copies the static resources from disk directly to the network card bypassing process memory(RAM), unlike this in node js u would use something like readFileStream to read the html file which loads it into the process memory first and then serves the file. Node will soon have access to this sendfile() call, which is still in testing, so soon enough there will be very little difference in terms of performance.So if you are planning to serve huge static files over and over, dont use node. 

Other thing is you can't get things like virtual hosts, automatic mime type detection, tons of other config options present in apache to work with node. So like Nicholas said, if you are programming a single page web app with lots of dynamic data, pushing capabilities etc. thats a good situation to use node in.

Also if you are a fan of short-form style like jade(for html) and stylus(for css), node provides pretty neat out of box functionality to serve these without too much headache.

'Backend > web server' 카테고리의 다른 글

Forward Proxy와 Reverse Proxy  (0) 2017.03.09
What is .htaccess?  (0) 2017.03.03
[OS]컨텍스트 스위칭(Contex Switching)  (0) 2017.03.02
Blocking / Non-Blocking  (0) 2017.03.02
Nginx vs Apache  (0) 2017.03.02
Comments