码迷,mamicode.com
首页 > 系统相关 > 详细

配置nginx worker 进程数

时间:2015-09-24 19:44:43      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:配置nginx worker 进程数


配置nginx worker 进程数


一般修改为cpu的核数的个数那么多


 cd /application/nginx/conf

 grep worker_processes nginx.conf

 sed -i ‘s/worker_processes  1/worker_processes  10/g‘ nginx.conf

 grep worker_processes nginx.conf

 /application/nginx/sbin/nginx -s reload

 ps -ef |grep nginx

##################################


[root@LNMP ~]# cd /application/nginx/conf

[root@LNMP conf]#  grep worker_processes nginx.conf

worker_processes  1;

[root@LNMP conf]# sed -i ‘s/worker_processes  1/worker_processes  10/g‘ nginx.conf

[root@LNMP conf]#  grep worker_processes nginx.conf                               

worker_processes  10;

[root@LNMP conf]# /application/nginx/sbin/nginx -s reload

[root@LNMP conf]# ps -ef |grep nginx         

nginx     1529  1519  0 09:06 ?        00:00:00 php-fpm: pool www            

nginx     1530  1519  0 09:06 ?        00:00:00 php-fpm: pool www            

nginx     1531  1519  0 09:06 ?        00:00:00 php-fpm: pool www            

nginx     1532  1519  0 09:06 ?        00:00:00 php-fpm: pool www            

nginx     1533  1519  0 09:06 ?        00:00:00 php-fpm: pool www            

nginx     1534  1519  0 09:06 ?        00:00:00 php-fpm: pool www            

nginx     1535  1519  0 09:06 ?        00:00:00 php-fpm: pool www            

root      8467     1  0 09:45 ?        00:00:00 nginx: master process /application/nginx-1.6.2/sbin/nginx

nginx     8733  8467  0 11:44 ?        00:00:00 nginx: worker process              

nginx     8734  8467  0 11:44 ?        00:00:00 nginx: worker process              

nginx     8735  8467  0 11:44 ?        00:00:00 nginx: worker process              

nginx     8736  8467  0 11:44 ?        00:00:00 nginx: worker process              

nginx     8737  8467  0 11:44 ?        00:00:00 nginx: worker process              

nginx     8738  8467  0 11:44 ?        00:00:00 nginx: worker process              

nginx     8739  8467  0 11:44 ?        00:00:00 nginx: worker process              

nginx     8740  8467  0 11:44 ?        00:00:00 nginx: worker process              

nginx     8741  8467  0 11:44 ?        00:00:00 nginx: worker process              

nginx     8742  8467  0 11:44 ?        00:00:00 nginx: worker process              

root      8744  8626  0 11:44 pts/1    00:00:00 grep nginx

[root@LNMP conf]# 



查看cpu方法(虚拟机无法查看)

grep ‘physical id’ /proc/cpuinfo


[root@client1 /]# grep ‘physical id‘ /proc/cpuinfo 

physical id     : 1

physical id     : 0

physical id     : 1

physical id     : 0

physical id     : 1

physical id     : 0

physical id     : 1

physical id     : 0

physical id     : 1

physical id     : 0

physical id     : 1

physical id     : 0

physical id     : 1

physical id     : 0

physical id     : 1

physical id     : 0

或者按top

先按top

之后再1

这样可以展示cpu


本文出自 “技术改变命运” 博客,请务必保留此出处http://lvnian.blog.51cto.com/7155281/1697771

配置nginx worker 进程数

标签:配置nginx worker 进程数

原文地址:http://lvnian.blog.51cto.com/7155281/1697771

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!