httpd workes become zombie process











up vote
0
down vote

favorite












I am running a php service in a docker container via apache + mod_php. For some reason sooner or later I get "Service unavailable" on reverse proxy. Inspecting the container I always find that all httpd workers became zombies and are no longer reaped by master process. I assumed it was due to zombie reaping issues in docker containers and attempted to solve it by adding tini as pid 1. Unfortunately it didn't solve the issue, I suppose because httpd master process is still running, so workers are actually not orphans to be reaped by pid 1. At this point I have no ideas on how to approach this problem and thus ask for your assistance.



Does anyone know how to debug this kind of issue?



Below is the output of the 'top' command run inside of container. I use plain alpine as base image with php7 installed via 'apk'.



    9     1 root     S     169m   1%   3   0% /usr/sbin/httpd -D FOREGROUND
5493 0 root S 1592 0% 1 0% sh
5501 5493 root R 1524 0% 2 0% top
1 0 root S 760 0% 0 0% /sbin/tini -- /usr/sbin/httpd -D F
5484 9 apache Z 0 0% 3 0% [httpd]
5492 9 apache Z 0 0% 0 0% [httpd]
5485 9 apache Z 0 0% 0 0% [httpd]
5490 9 apache Z 0 0% 3 0% [httpd]
5486 9 apache Z 0 0% 0 0% [httpd]
5487 9 apache Z 0 0% 1 0% [httpd]
5483 9 apache Z 0 0% 3 0% [httpd]
5482 9 apache Z 0 0% 1 0% [httpd]
5489 9 apache Z 0 0% 1 0% [httpd]
5491 9 apache Z 0 0% 3 0% [httpd]
5488 9 apache Z 0 0% 0 0% [httpd]









share|improve this question






















  • 1: does it do that with simple static, only HTML content? That would indicate a PHP code issue (infinite loop of some kind?). Thus debug PHP. 2 What MPM module do you use? Show us your configurations: which MPM, what performance parameters are set. I am curious at MaxConnectionsPerChild. Set it different than 0 so the master process kills and start new child processes once in a while.
    – Nic3500
    Nov 10 at 18:28












  • 3 since you talk of a proxy, the child processes are waiting for a response from some backend server. If you set the timeouts to 0, and the backend does not respond, the processes will appear stuck and do nothing.
    – Nic3500
    Nov 10 at 18:32










  • @Nic3500 The service itself is not a reverse proxy. I just use it as a router to the service itself.
    – foverzar
    Nov 11 at 8:00















up vote
0
down vote

favorite












I am running a php service in a docker container via apache + mod_php. For some reason sooner or later I get "Service unavailable" on reverse proxy. Inspecting the container I always find that all httpd workers became zombies and are no longer reaped by master process. I assumed it was due to zombie reaping issues in docker containers and attempted to solve it by adding tini as pid 1. Unfortunately it didn't solve the issue, I suppose because httpd master process is still running, so workers are actually not orphans to be reaped by pid 1. At this point I have no ideas on how to approach this problem and thus ask for your assistance.



Does anyone know how to debug this kind of issue?



Below is the output of the 'top' command run inside of container. I use plain alpine as base image with php7 installed via 'apk'.



    9     1 root     S     169m   1%   3   0% /usr/sbin/httpd -D FOREGROUND
5493 0 root S 1592 0% 1 0% sh
5501 5493 root R 1524 0% 2 0% top
1 0 root S 760 0% 0 0% /sbin/tini -- /usr/sbin/httpd -D F
5484 9 apache Z 0 0% 3 0% [httpd]
5492 9 apache Z 0 0% 0 0% [httpd]
5485 9 apache Z 0 0% 0 0% [httpd]
5490 9 apache Z 0 0% 3 0% [httpd]
5486 9 apache Z 0 0% 0 0% [httpd]
5487 9 apache Z 0 0% 1 0% [httpd]
5483 9 apache Z 0 0% 3 0% [httpd]
5482 9 apache Z 0 0% 1 0% [httpd]
5489 9 apache Z 0 0% 1 0% [httpd]
5491 9 apache Z 0 0% 3 0% [httpd]
5488 9 apache Z 0 0% 0 0% [httpd]









share|improve this question






















  • 1: does it do that with simple static, only HTML content? That would indicate a PHP code issue (infinite loop of some kind?). Thus debug PHP. 2 What MPM module do you use? Show us your configurations: which MPM, what performance parameters are set. I am curious at MaxConnectionsPerChild. Set it different than 0 so the master process kills and start new child processes once in a while.
    – Nic3500
    Nov 10 at 18:28












  • 3 since you talk of a proxy, the child processes are waiting for a response from some backend server. If you set the timeouts to 0, and the backend does not respond, the processes will appear stuck and do nothing.
    – Nic3500
    Nov 10 at 18:32










  • @Nic3500 The service itself is not a reverse proxy. I just use it as a router to the service itself.
    – foverzar
    Nov 11 at 8:00













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am running a php service in a docker container via apache + mod_php. For some reason sooner or later I get "Service unavailable" on reverse proxy. Inspecting the container I always find that all httpd workers became zombies and are no longer reaped by master process. I assumed it was due to zombie reaping issues in docker containers and attempted to solve it by adding tini as pid 1. Unfortunately it didn't solve the issue, I suppose because httpd master process is still running, so workers are actually not orphans to be reaped by pid 1. At this point I have no ideas on how to approach this problem and thus ask for your assistance.



Does anyone know how to debug this kind of issue?



Below is the output of the 'top' command run inside of container. I use plain alpine as base image with php7 installed via 'apk'.



    9     1 root     S     169m   1%   3   0% /usr/sbin/httpd -D FOREGROUND
5493 0 root S 1592 0% 1 0% sh
5501 5493 root R 1524 0% 2 0% top
1 0 root S 760 0% 0 0% /sbin/tini -- /usr/sbin/httpd -D F
5484 9 apache Z 0 0% 3 0% [httpd]
5492 9 apache Z 0 0% 0 0% [httpd]
5485 9 apache Z 0 0% 0 0% [httpd]
5490 9 apache Z 0 0% 3 0% [httpd]
5486 9 apache Z 0 0% 0 0% [httpd]
5487 9 apache Z 0 0% 1 0% [httpd]
5483 9 apache Z 0 0% 3 0% [httpd]
5482 9 apache Z 0 0% 1 0% [httpd]
5489 9 apache Z 0 0% 1 0% [httpd]
5491 9 apache Z 0 0% 3 0% [httpd]
5488 9 apache Z 0 0% 0 0% [httpd]









share|improve this question













I am running a php service in a docker container via apache + mod_php. For some reason sooner or later I get "Service unavailable" on reverse proxy. Inspecting the container I always find that all httpd workers became zombies and are no longer reaped by master process. I assumed it was due to zombie reaping issues in docker containers and attempted to solve it by adding tini as pid 1. Unfortunately it didn't solve the issue, I suppose because httpd master process is still running, so workers are actually not orphans to be reaped by pid 1. At this point I have no ideas on how to approach this problem and thus ask for your assistance.



Does anyone know how to debug this kind of issue?



Below is the output of the 'top' command run inside of container. I use plain alpine as base image with php7 installed via 'apk'.



    9     1 root     S     169m   1%   3   0% /usr/sbin/httpd -D FOREGROUND
5493 0 root S 1592 0% 1 0% sh
5501 5493 root R 1524 0% 2 0% top
1 0 root S 760 0% 0 0% /sbin/tini -- /usr/sbin/httpd -D F
5484 9 apache Z 0 0% 3 0% [httpd]
5492 9 apache Z 0 0% 0 0% [httpd]
5485 9 apache Z 0 0% 0 0% [httpd]
5490 9 apache Z 0 0% 3 0% [httpd]
5486 9 apache Z 0 0% 0 0% [httpd]
5487 9 apache Z 0 0% 1 0% [httpd]
5483 9 apache Z 0 0% 3 0% [httpd]
5482 9 apache Z 0 0% 1 0% [httpd]
5489 9 apache Z 0 0% 1 0% [httpd]
5491 9 apache Z 0 0% 3 0% [httpd]
5488 9 apache Z 0 0% 0 0% [httpd]






php apache docker unix zombie-process






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 at 15:40









foverzar

1029




1029












  • 1: does it do that with simple static, only HTML content? That would indicate a PHP code issue (infinite loop of some kind?). Thus debug PHP. 2 What MPM module do you use? Show us your configurations: which MPM, what performance parameters are set. I am curious at MaxConnectionsPerChild. Set it different than 0 so the master process kills and start new child processes once in a while.
    – Nic3500
    Nov 10 at 18:28












  • 3 since you talk of a proxy, the child processes are waiting for a response from some backend server. If you set the timeouts to 0, and the backend does not respond, the processes will appear stuck and do nothing.
    – Nic3500
    Nov 10 at 18:32










  • @Nic3500 The service itself is not a reverse proxy. I just use it as a router to the service itself.
    – foverzar
    Nov 11 at 8:00


















  • 1: does it do that with simple static, only HTML content? That would indicate a PHP code issue (infinite loop of some kind?). Thus debug PHP. 2 What MPM module do you use? Show us your configurations: which MPM, what performance parameters are set. I am curious at MaxConnectionsPerChild. Set it different than 0 so the master process kills and start new child processes once in a while.
    – Nic3500
    Nov 10 at 18:28












  • 3 since you talk of a proxy, the child processes are waiting for a response from some backend server. If you set the timeouts to 0, and the backend does not respond, the processes will appear stuck and do nothing.
    – Nic3500
    Nov 10 at 18:32










  • @Nic3500 The service itself is not a reverse proxy. I just use it as a router to the service itself.
    – foverzar
    Nov 11 at 8:00
















1: does it do that with simple static, only HTML content? That would indicate a PHP code issue (infinite loop of some kind?). Thus debug PHP. 2 What MPM module do you use? Show us your configurations: which MPM, what performance parameters are set. I am curious at MaxConnectionsPerChild. Set it different than 0 so the master process kills and start new child processes once in a while.
– Nic3500
Nov 10 at 18:28






1: does it do that with simple static, only HTML content? That would indicate a PHP code issue (infinite loop of some kind?). Thus debug PHP. 2 What MPM module do you use? Show us your configurations: which MPM, what performance parameters are set. I am curious at MaxConnectionsPerChild. Set it different than 0 so the master process kills and start new child processes once in a while.
– Nic3500
Nov 10 at 18:28














3 since you talk of a proxy, the child processes are waiting for a response from some backend server. If you set the timeouts to 0, and the backend does not respond, the processes will appear stuck and do nothing.
– Nic3500
Nov 10 at 18:32




3 since you talk of a proxy, the child processes are waiting for a response from some backend server. If you set the timeouts to 0, and the backend does not respond, the processes will appear stuck and do nothing.
– Nic3500
Nov 10 at 18:32












@Nic3500 The service itself is not a reverse proxy. I just use it as a router to the service itself.
– foverzar
Nov 11 at 8:00




@Nic3500 The service itself is not a reverse proxy. I just use it as a router to the service itself.
– foverzar
Nov 11 at 8:00

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240538%2fhttpd-workes-become-zombie-process%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240538%2fhttpd-workes-become-zombie-process%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Coverage of Google Street View

Full-time equivalent

Surfing