Nginx configuration and the role of architecture in LNMP

1.LNMP architecture access process

 

 

  Users access the site through the first visit Nginx web, static files directly back to the customer, dynamic document will be requested by the PHP-FCGI service, this configuration needs to be written in the Nginx configuration file, you can jump dynamic.

2.Nginx applications

  1, static server (pictures, video services). Concurrency: 1-3W

    html, js, css, .flv and so on.

  2, dynamic service, nginx + fastcgi way to run php, jsp. Concurrency: 500-1500

  3, reverse proxy, load balancing. Day PV2000W look, the agent can be directly used Nginx.

  4, the cache service. Squid, varnish

Contrast 3.Nginx and other web servers

  1)Apache

  · The current version is very stable and strong.

  · Prefork mode canceled the process cost, high performance.

  • When dealing with dynamic business data, due to the back-end engine and associated databases, Apache itself is not the bottleneck.

  Consumption of system resources is relatively a little more time-high concurrency.

  · Traditional select model.

  Features: multi-function, more stable, more secure, plug-ins and more.

  2)Nginx

  · Asynchronous IO model (epoll, kqueue) based on the strong performance to support thousands of concurrent.

  · Small file support is very good, very high performance (static limit of small files).

  Beautiful-code extensions must be compiled into the main program.

  · Relatively low consumption of system resources.

  3) Lighttpd (Baidu Post Bar, watercress)

  · Asynchronous IO model. Nginx performance and similar

  • When extensions SO mode, to be flexible than Nginx

  · Global utilization is relatively low, no two good safety performance above.

Guess you like

Origin www.cnblogs.com/zrxuexi/p/11941772.html