Apache spawning zombie processes when php is called

你。 提交于 2019-12-06 13:09:02

A process is “zombie” (which in top appears as Z) immediately after it exits (normally or not) Its process ID stays in the process table until its parent waits on (or “reaps”) it. Under normal circumstances, when the parent process sets up a signal handler for SIGCHLD so that, when the signal is sent (upon a child process's exit), the parent process then reaps it at its convenience.

If the parent process has hung for some reason, such as if it's suspended, or is too busy, or is deadlocked, then child processes that exit will not be reaped (until the parent process resumes again).

Usually, the main Apache process will reap any of its workers that exit. However, on a heavily-loaded server like you describe, the main process may not have enough time available to it to do this reaping. Unreaped (“zombie”) processes show up as in top.

In this case, the processes are normal and are not of concern, unless there are many, many unreaped processes.

When your test is over, do the zombie processes disappear after a short time? if so, you have nothing to worry about everything is normal.

By default, apache is set up for worker processes to exit after handling a limited number of requests. This is designed to not allow memory leaks to get out of hand. You might find tweaking this setting might help you.

First, to boost performance, you can put the information from your .htaccess file in apache main config file. Every time the directory which contains the .htacess, is being accessed it will read and load the .htaccess file unlike putting rewrite rules in you apache config, which is only loaded once, during startup.

About the php problem - if never heard about suPHP, but you could rather run fastcgi in conjunction with apache or - switch to fpm/nginx. I've been using it for a month now and it's much faster than Apache. I mean 2-3 times the performance.

Nginx has all the features Apache has. So rewrite rules, htaccess like security.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!