5,待所有旧版本的worker process全部退出,
仅由新的工作进程来处理输入的请求了。 使用kill -QUIT 14859 【老版本的Nginx主进程号】 从容关闭旧版本master(主进程号)。完成版本升级。
此时查看nginx版本信息、编译信息、及进程信息;
[root@test nginx-1.5.6]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.5.6
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-54)
TLS SNI support disabled
configure arguments: --user=appusr --group=appusr --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module 【可以看到新版本添加的--user --group 参数】
以下为新版本的进程信息
[root@test shell]# ps -ef |egrep nginx
root 4906 1 0 11:19 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
appusr 4907 4906 8 11:19 ? 00:00:15 nginx: worker process
appusr 4908 4906 8 11:19 ? 00:00:15 nginx: worker process
appusr 4909 4906 8 11:19 ? 00:00:15 nginx: worker process
appusr 4910 4906 9 11:19 ? 00:00:16 nginx: worker process
root 5082 29465 0 11:22 pts/0 00:00:00 egrep nginx
再查看开头提到的webbench 测试我总共请求10分钟并发1000 共88万个请求仅5个请求失败。证明这次平滑升级没有影响线上服务。