Ubuntu 如何确定辅助进程的数量

Ubuntu 如何确定辅助进程的数量,ubuntu,nginx,Ubuntu,Nginx,下面是在ubuntu上安装nginx的教程。我已经安装了nginx,并且它已成功启动。本教程介绍了如何调整和设置nginx进程和辅助连接 It is often recommended to set the number of NGINX workers equal the number of processors, you can determine the number of processors using: cat /proc/cpuinfo | grep processor 当我

下面是在ubuntu上安装nginx的教程。我已经安装了nginx,并且它已成功启动。本教程介绍了如何调整和设置nginx进程和辅助连接

It is often recommended to set the number of NGINX workers equal the number of processors, you can determine the number of processors using:

cat /proc/cpuinfo | grep processor 
当我运行该命令时,我得到一个0

processor   : 0
因此,根据教程,我应该在适当的位置将配置设置为0

sudo nano /etc/nginx/nginx.conf


worker_processes 0;
本教程的示例有一个1。然而,当我运行输出时,我不仅有点担心看到0,而且当我运行
ps-ef | grep nginx
时,我得到了这个输出,这表明存在多个工作进程

root      1824     1  0 19:40 ?        00:00:00 nginx: master process /usr/sbinnginx
www-data  1825  1824  0 19:40 ?        00:00:00 nginx: worker process
www-data  1826  1824  0 19:40 ?        00:00:00 nginx: worker process
www-data  1827  1824  0 19:40 ?        00:00:00 nginx: worker process
www-data  1828  1824  0 19:40 ?        00:00:00 nginx: worker process
michael   1832  1378  0 19:44 pts/1    00:00:00 grep --color=auto nginx

当我运行
cat/proc/cpuinfo | grep processor
时,我是否会看到一个0,以及我应该设置什么
worker|u进程0
到/etc/nginx/nginx.conf?

计数从
0开始,因此只有
处理器:0
意味着您只有一个处理器/核心


我不确定,但我假设
worker\u处理0
表示无限,因此我认为如果您希望它与您拥有的处理器数量相对应,您应该将其更改为
worker\u processs 1

大家好,我正在安装Nginx,我也看到了4个工作进程。我应该把它们限制在一个还是可以?我假设我接触的配置越少,就越容易维护它。你认为呢?