Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the disadvantages of building web server by nodejs?

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail the shortcomings of building a web server with nodejs. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

The disadvantages of building a web server by nodejs: 1. Nodejs single-threaded, unable to do cpu-intensive operations, resulting in time slice cannot be released, blocking subsequent tasks; 2, nodejs reliability is relatively low; 3, when using multi-core performance, you need to use cluster or deploy multiple instances, which is troublesome and so on.

This tutorial operating environment: windows7 system, nodejs version 12.19.0, DELL G3 computer.

Advantages and disadvantages of Nodejs as web server

Disadvantages:

1.nodejs single-thread, can not do cpu-intensive operations, resulting in time slices can not be released, blocking the following tasks.

The reliability of 2.nodejs is relatively low, and an error report in one place will cause the entire program to crash, which needs to be solved by a daemon or docker restart.

3. For example, it is troublesome to use cluster or deploy multiple instances when using multi-core performance.

4. Memory defaults to 0.7 GB and 1.4 GB. Garbage collection will slow down when the setting is large, and several more instances may need to be deployed.

The backend of 5.nodejs type is difficult to recruit, and you need to transfer the frontend to backend or backend to nodejs.

Advantages:

1.nodejs underlying asynchronous io, the performance is good.

two。 You don't have to worry about threads when writing.

3. The development speed is high, the weak type language is more flexible, and it does not need all kinds of transformations and less code like the strong type.

4. It is convenient to use ssr on a single page, and the context is the same.

5. The front-end conversion to nodejs is relatively proficient in grammar.

This is the end of this article on "what are the shortcomings of nodejs building web server". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report