Preface:
Tomcat theory concurrent processing ability, about 500 bar, even through some optimization, can improve a little, but, does not achieve qualitative change, up to hundreds of. For non-Internet projects, it's really enough. In the enterprise, if you want to reach 500 concurrency, first you have to have more than 500 people, 罒 Ω 罒, second, even if you more than 500 people, and the likelihood of access is very low. But for Internet projects, 500 concurrency is really a bit low.
If you want to increase the amount of concurrency, is it possible to swap a server, or, in front of the Tomcat cluster, add a cow B to receive high-concurrency servers, and then let this server, assigned to the cluster of Tomcat, let him be a leader, to assign tasks to different tomcat. Just like this:
If there are 1200 concurrency, there is an overload of work for a single tomcat, which can be greatly avoided. Before 1 dozen 1200, now has two partners, you can 3 dozen 1200, on average, into 1 dozen 400, no problem ah, played, is put. 1200 concurrency, for Nginx, can be said to be able to, because of his concurrent processing ability, can reach about 5w. With the release of the update, this is not higher, it is unclear. Can only say, more bull B.
about NginxOne.: Http://nginx.org/en/download.html two. Installation
Java server, generally choose Linux, so, Nginx I also installed in the Linux environment.
1. Environmental preparedness
Because Nginx is written in C, you need to install the GCC environment
Yum Install gcc-c++
Nginx HTTP module uses PCRE to parse the regular expression, so, to be loaded
Yum install-y pcre Pcre-devel
Nginx uses zlib to make the contents of the HTTP package gzip, so, to be loaded
Yum install-y zlib Zlib-devel
Nginx not only supports the HTTP protocol, but also supports HTTPS protocol, so, to install
Yum Install-y OpenSSL Openssl-devel
2. Installation
Extract
TAR-ZXVF nginx-1.12.2.tar.gz-c/usr/java
Take a look at the extracted directory
Create a folder
Mkdir-p/var/temp/nginx
This directory is useful when a configure command is executed, and of course, it is also possible to create the directory once the Configure is finished.
Configure command: (a bit long, but it doesn't matter AH)
./--prefix=/usr/local/--pid-path=/var/run/nginx/--lock-path=/var/lock/-- error-log-path=/var/log/nginx/--http-log-path=/var/log/nginx/--with--- http-client-body-temp-path=/var/temp/nginx/--http-proxy-temp-path=/var/temp/nginx/-- http-fastcgi-temp-path=/var/temp/nginx/--http-uwsgi-temp-path=/var/temp/nginx/-- http-scgi-temp-path=/var/temp/nginx/scgi
Next execute the Make command
Make
When you are finished, continue to execute
Make install
When you're done, switch to the/usr/local/nginx directory to see
Cd/usr/local/nginx
3. Start Nginx
Executing commands in the/usr/local/nginx directory
Sbin/nginx
At this time, see the console does not have any message display, as if not executed, at this time, can query, whether really run up
PS Aux|grep Nginx
Found there are three information, the first two are, the third is the implementation of the PS command appears.
Since there is a start, it will naturally be closed.
./nginx-s quit
Execution of this command is required in the Sbin directory.
If I in the configuration file, add a server configuration information, this time, if I want to close nginx, in open nginx, experience is not very good ah, there is no refresh instructions?
The Refresh instructions come:
./nginx-s Reload
Similarly, this command needs to be executed in the Sbin directory.
Question: Do not get sbin to execute only, I installed, after a long time, forget where the directory is, how to engage? That little dumb-dumb guy, remember?
There's no need to do this. You can use the Whereis command to find it.
Just get the path, the CD in, it's okay.
three. Verification
Run up, there is no way, to intuitively verify, whether really run up?
Because of Linux, I ran the virtual machine, so I was under Windows, using Google Chrome, directly entering the Linux IP, to see
This is very intuitive.
Then I would like to ask, this reality of the content, it should be an HTML file, where is the HTML file? And where was it configured?
Nginx Introduction-Deploy to Linux