Linux 为什么有这么多apache进程在运行?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20568770/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 01:38:27  来源:igfitidea点击:

Why there are so many apache processes running?

linuxapacheamazon-ec2

提问by Jason

I am hosting a small testing website with Apache running on Linux, using free EC2 Micro instance.

我正在托管一个小型测试网站,Apache 运行在 Linux 上,使用免费的 EC2 Micro 实例。

When I tried to look at background process with "top", I saw a lot of (30+) "apache" user

当我试图用“top”查看后台进程时,我看到了很多(30+)“apache”用户

PID    user     PR   NI VIRT RES   SHR S  %CPU %MEM  TIME+   COMMAND

12104 apache    20   0  429m 9024 2420 S  1.0  0.2   0:02.91  httpd              
12273 apache    20   0  429m 9108 2504 S  1.0  0.2   0:01.20  httpd              
...

I am not sure this is normal. Does this mean I may be attached by someone/virus?

我不确定这是否正常。这是否意味着我可能被某人/病毒附身?

P.S. I only expect 2-3 test users to use it at all at this point. It's a php + apache + mysql architect.

PS 我现在只希望 2-3 个测试用户使用它。它是一个 php + apache + mysql 架构师。

thanks.

谢谢。

采纳答案by Guntram Blohm supports Monica

Apache will pre-create worker processes so, when a load spike comes in, the processes can pick up the requests immediately, instead of waiting for the master to spawn enough of them. Check your httpd.conf for MinSpareServers, MaxSpareServers and ServerLimit.

Apache 将预先创建工作进程,因此,当出现负载高峰时,进程可以立即接收请求,而不是等待主进程产生足够多的请求。检查您的 httpd.conf 中的 MinSpareServers、MaxSpareServers 和 ServerLimit。