Nginx最高并发5万。
大型企业应用都是多台服务器,Nginx多台,PHP多台,MySQL多台
一、Nginx介绍
Nginx是一个高性能的、轻量级的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP服务器。由俄罗斯的Igor Sysoev为俄罗斯的访问量第二的Rambler.ru站点开发。特点是稳定,丰富功能集,示例配置文件和低系统资源消耗,高并发能力强。国内使用Nginx的有百度、新浪、网易、腾讯(大多公司都在用)。
支持7x24小时不间断运行。并发能力能达到5万并发连接数。Nginx选择了epoll and kqueue开发模型。可以不间断服务的情况下进行软件升级。
二、Nginx安装
1、查看CentOS版本
[root@localhost ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root@localhost ~]#
[root@localhost ~]# rpm -q centos-release
centos-release-7-1.1503.el7.centos.2.8.x86_64
[root@localhost ~]#
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]#
[root@localhost ~]# cat /proc/version
Linux version 3.10.0-229.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Fri Mar 6 11:36:42 UTC 2015
[root@localhost ~]#
[root@localhost ~]# cat /etc/issue
\S
Kernel \r on an \m
[root@localhost ~]#
[root@localhost ~]# file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0xec333a104e045327c5e3d0ca6dda16c610a210f3, stripped
[root@localhost ~]#
// LSB --- Linux Standard Base
[root@localhost yum.repos.d]# lsb_release -a
LSB Version::core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID:CentOS
Description:CentOS Linux release 7.1.1503 (Core)
Release:7.1.1503
Codename:Core
[root@localhost yum.repos.d]#
2、下载wget
3、解压缩
(1)解压缩tar.gz包
tar -xvf xxx.tar -C /home/xxx/dirName
(2)解压缩zip包
yum install p7zip
yum install unzip
软件包 p7zip-16.02-1.el7.x86_64 已安装并且是最新版本
4、编译安装
(1)了解Nginx的详细编译参数