The theory and actual practice of Nginx Web Service

Source: Internet
Author: User
Tags epoll

Nginx

LNMP (linux nginx mysql php) also called LEMP (Linux engin x nginx mysql php)

3w Concurrent, ten threads, just 150m memory .... A little exaggeration, also shows good.

Nginx Features:

A.WWW Web Services

B. load Balancing ( reverse proxy )

C.web Cache(Web cache)

The advantages of Nginx:

0, the configuration is simple, flexible.

1. High concurrency (static small files), static 1-2w,Apache concurrent 3-5 thousand.

2. consumes less resources.

3. features are many, each function is not particularly strong.

4. supports the Epoll model. Allows nginx to support high concurrency.

5. different from Apache with dynamic service

6. The use of Nginx can be limited to the IP limit , you can limit the number of connections,Apache but also third-party.

call Phpfastcgi will need php Send to fcgi 9000 port parsing. fcgi is a dynamic concurrency bottleneck 500-1500 mysql 300-1500 sql statement processing is not good, concurrency is smaller.

Day pv2000 million below, can be directly with nginx agent,Apache can also act as agent, but the performance is very poor, generally no one uses.

Nginx Cache is equivalent to vanish,squid.

Nginx adopts epoll model (using directory mode)

Apache uses select model (with select, flip-page search)

final recommendation, external business Nginx, internal Apache

Install the pcre openssl,yum install . nginx installation module must be done one at a time, not like Apache later through the module apxs way to press in.

then compile and install nginx:

Useradd nginx-s/sbin/nologin-m

cd/home/weipeng/tools/nginx-1.6.2

./configure \

--user=nginx \

--group=nginx \

--prefix=/application/nginx1.6.2 \

--with-http_stub_status_module \

--with-http_ssl_module

Make&&make Install

Ln-s/application/nginx1.6.2/application/nginx

then start the Nginx:

1. /application/nginx/sbin/nginx-t Check Syntax

2. /application/nginx/sbin/nginx start nginx

3. lsof-i: View boot port

local Curl 192.168.44.20 then browser access to see the Welcome to Nginx Web page.


The theory and actual practice of Nginx Web Service

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.