How can I prevent tons of apache processes spawning when I start apache and proceeding to kill my machine?

后端 未结 6 2033
执笔经年
执笔经年 2021-01-30 08:29

I have a highly trafficked application on one debian machine and apache has started acting strange.

Every time I start apache, tons of apache processes are spawned, the

6条回答
  •  面向向阳花
    2021-01-30 09:02

    As has been said (assuming Prefork Apache) - MaxClients = max processes at once.

    If you find you are getting hammered with real traffic (and not a mis-configured StartServers/Min/MaxSpareServers), there are some other things you can do:

    1. Set up a separate, lightweight apache process (or lighttpd) for your static content. That way all the small, static stuff doesn't "pollute" your heavy-weight app process. This can be on the same server, or a different one. Doesn't matter.
    2. Put a reverse proxy like Squid in front of your Apache process. The reverse proxy will quickly suck down the content from Apache and store it in memory and then parcel it back out to the client. This way AOL users on 14.4kb modems don't hog one of your valuable Apache slots. As a bonus, such a setup can be configured to cache some of your content to reduce the load on your Apache processes.

提交回复
热议问题