ngnix applicable and which scene

 

 

 Initiating a web request, go through ngnix, then our application services (such as: tomcat), then go visit our caching services (for example: redis) or our database (for example: mysql). Finally, to provide basic data services.

But there is a problem: our application development services because they require very high efficiency, so it's operating efficiency is very low. It qps, or tps, or concurrency are restricted, so we need to put a lot of such applications and services make up a cluster.

Provide high availability to users. And once, when many application services that constitute a cluster, we need ngnix with a reverse proxy functionality, can be passed to the user dynamic request. Many applications make up the cluster, it will bring two requirements:

1. We need a dynamic expansion.

2. Some services when something goes wrong, we need to do disaster recovery.

So this way, we must have a reverse proxy load balancing. Second, such a link, ngnix is ​​at the edge of a node within the enterprise network. With the growth of our network links, users experience the delay will increase.

So if we can put some appear to all users of the same or a period of time looks the same dynamic content caching in ngnix part, provide access to users by the ngnix directly. Well, this is the case, the user will reduce a lot of the time delay.

Therefore, it is derived from the reverse proxy another feature called caching. It can accelerate our visit. And many times, we like css or javascript file access or as some small pictures, then such a static resource, it is not necessary

By the application to access the service. It requires static resources placed on the local file system that provides direct access from the ngnix it. This is ngnix static resources.

So, the third scenario, it is because the application service performance itself of the problem, but a good database application services and more than service. Because the business scene database service is relatively simple, and its concurrent performance to be much higher than the TPS application services.

 

Guess you like

Origin www.cnblogs.com/mrcoderwrong/p/11595249.html