Is the sweet feelings between the Internet and Apache broken? According to the current situation, the sweet feelings between the Internet and Apache seem to have been broken, which means that the kings who have dominated the continent over the past decade have finally begun to show fatigue. Although Apache still supports most of the world's websites, in the past few years, Nginx (engine-x) is constantly encroaching on its market share.
The rapid increase in the popularity of Nginx and the steady decline in the market share of Apache Web servers can not help but cause many guesses. Many practitioners believe that this trend will make the solution selection in the new deployment process clearer. In fact, I have recently been busy setting up a large server and finally chose Nginx as my own tool-but is my choice correct?
According to the current situation, the sweet feelings between the Internet and Apache seem to have been broken, which means that the kings who have dominated the continent over the past decade have finally begun to show fatigue. Although Apache still supports most of the world's websites, in the past few years, Nginx (engine-x) is constantly encroaching on its market share.
With its event-driven design, Nginx has surpassed Apache's process-driven design and become a popular solution that suits the current computer hardware situation. From the perspective of results, Nginx can surpass Apache's concurrent customer support and higher data throughput under certain circumstances on the same hardware. However, we should not simply use this as a criterion. We should also consider what we are doing using server devices.
Nginx has an advantage in processing static content, and its execution efficiency is higher than that of Apache, but Apache's static content processing speed is also not slow. Static content is the simplest processing item for any Web server. Therefore, high-traffic websites tend to use more complex backend systems to generate static content, this allows you to meet your needs more quickly and comprehensively. However, the intervention of PHP brings more difficulties to this process.
The most important problem is that when we select a Web server configuration solution, the most important problem is to find out how we can use this server. If you only need to use it to support a single site, and this server runs an independent database system dedicated to serving as a web server, therefore, it is wise to choose Nginx-after all, Nginx is superior to Apache in terms of traffic processing capabilities. In addition, Nginx itself provides the configuration function to achieve scale expansion in a simpler way than Apache if necessary, which is another advantage. However, if you plan to host multiple sites and a large number of applications on this server, such as multiple Wordpress sites, the answer is not that clear. In this case, the performance bottleneck may come from PHP rather than web servers.
In the face of this situation, you may think like this: Well, if PHP is difficult for both types of web servers and Nginx is faster in processing static files, why not directly choose Nginx? Apache has its own unique advantages. This is a mature platform with a wide range of support solutions in the Linux field. Many functions that can be directly used in Apache may require careful research and configuration on the Nginx side. Many control platforms and automated configuration tools are currently unavailable in Nginx, and technical teams may be more familiar with Apache and be good at diagnosing problems. These are all important advantages that need to be carefully considered.
In most cases, the performance improvement caused by Nginx is negligible. Unless you need to host billions of massive sites, the advantage of traffic is basically hard to be reflected. You should take actual requirements and existing skill reserves as the main reference factors. If we want to use a new technology as a learning practice on our personal blog, it is no problem to choose any favorite platform. If you want to set up a hosted server or a key business application, you should be careful when looking at the options. All the work is handed over to Nginx just for speed consideration. Such a judgment method is obviously easy to cause serious consequences.
Finally, the best processing strategy is to combine different technologies, rather than simply relying on a single web server platform. Websites that need to handle a large amount of traffic require the introduction of multi-layer mechanisms in the architecture, while web servers are only a small part of this comprehensive system. Most common sites should give priority to solutions that are more familiar to technicians and compare the performance of specific types of performance that require attention. Apache is still an excellent engine and maintains a high popularity. With the continuous development and maturity, Nginx will gradually improve and surpass Apache in the next five years.
To make a choice between the two, the correct answer is based on the situation. If you plan to host Wordpress, a very common site scenario, I think both of these solutions can deliver superior performance. Using Nginx to cache site content (we suggest you do this) can improve performance, however, this also means that the advantages of Apache in out-of-the-box use, compatibility, and low-difficulty learning curves need to be sacrificed. If you need to run PHP applications, the improvement brought by using the opcode caching mechanism such as APC is much higher than the tangle between the two web servers. In my opinion, Nginx is not a panacea. Just because Apache is old and not as cool as Nginx in the new generation, it is easy to make a choice that will eventually bring you into trouble.
English: http://www.itworld.com/consumerization-it/421347/choosing-linux-web-server-nginx-vs-apache? Source = ITWNLE_nlt_today_2014-06-03