Windows uses Nginx to implement a Web site load Balancing test Instance _win server

Source: Internet
Author: User

If you are concerned about Nginx, you must know what is the use of Nginx software, if your site access is more and more high, a server has no way to withstand the flow of pressure, then increase the number of servers to do load it. Do site load can buy hardware equipment to achieve, for example, F5, but the price is hundreds of thousands of to millions, enough expensive, this article introduces to do the website load software is free, nginx at present many portal sites and large traffic sites are used as HTTP server, so Nginx is very excellent, Here's how to do the load test.
Environment:
(2 servers)
First station:
Cpu:inter (R) Pentium (r) 4 CPU 2.8G
Memory: 1G
System: Windows 7
Iis:iis 7
nginx:nginx/windows-0.8.22
ip:172.10.1.97
Environment: Local
Second Station:
Cpu:inter (R) Pentium (r) 4 CPU 3.0G
Memory: 2G
System: Windows Server 2003
Iis:iis 6
ip:172.10.1.236
Environment: Remote

Description
This test, the software Nginx placed locally (172.10.1.97), that is, placed in the domain name binding of the server, this server IIS can not use 80 ports, because the next nginx software to use 80 of this port.
Download Nginx's address is as follows:
Nginx Download:http://nginx.net/
Download of the version used in this test:nginx/windows-0.8.22

Download extract to C:, change directory name to Nginx

OK, here goes the practice:

First:

In the local (172.10.1.97) server, IIS creates a Web site using a port of 808, as shown below:

IIS Web site bindings settings diagram

Second:

Create a Web site in remote 172.10.1.236 IIS using a port of 80, as shown below:

Remote IIS Binding settings diagram

Third:

OK, the above has been set up two server IIS, the following configuration Nginx software to achieve the Web site load Balancing, open the following file:

C:\nginx\conf\nginx.conf

1. Find Content Server {

Add the following to the above section:

Upstream xueit.com {
Server 172.10.1.97:808;
Server 172.10.1.236:80;
}

(This is the server Web site IP used by the load switch)

2, find location/{
root HTML;
Index index.html index.htm;
}

Change the content as follows:

Location/{
Proxy_pass http://xueit.com;
Proxy_redirect default;
}

3. Locate server {
Listen 80;
server_name localhost;

Change the content to read as follows:

server {
Listen 80;
server_name 172.10.1.97;

(This is a request to monitor access to the server 80 port of the domain binding)

OK, here is the simple configuration, below look at the above 3 steps configuration diagram:

Load configuration diagram

Fourth:

All configured, the following start nginx this software

Enter the command prompt cmd, enter the C:\nginx>, enter the Nginx command, as shown below:

Start Nginx

At this point, the system process has two nginx.exe processes, as shown in the following figure:

System Nginx Process

Stop Nginx Run input nginx-s stop

Fifth:

After the above configuration, now we look at the load effect:

On the local (172.10.1.97) This server opens IE, input:http://172.10.1.97

The first time you open a Web site's results chart:

Run Web site map for the first time

Refresh the page and the resulting chart:

Visit the site map again

Very well, the website has been loaded successfully.

After this test, the implementation of the site load is no longer difficult. You don't have to buy very expensive hardware devices. Online introduction said Nginx software can deal with tens of thousands, so is definitely a very good choice.

If the site traffic is very large, you can specifically use a server to run Nginx, other server Run Web site program (a few server procedures are the same), so the load is not too big problem, if not again, the site to do a number of columns to do a 2-level domain name, 2 domain name also do the load, so more powerful it.

Nginx software runs better on Linux than it does on windows, so doing the load can be done with Linux run Nginx,.net Web sites that are developed on Windows Server IIS.

This article is from: http://www.xueit.com/usenetwork/show-4866-1.aspx

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.