Apache status - Log Processes are not dying
Hello all,
Yesterday, I noticed that the I've hit the Max_Clients count on the server, So I restarted the apache and all went fine.
Today, I was checking again, and I noticed that Log processes are not dying (Under SS column the numbers are like 12442 ..).
With my very little linux knowledge and some googling. I tried to debug this issue but hit a dead end and I hope that someone can give me a hint or help me with this issue.
I took one of the Log processes with PID = 35343
I run
strace -p 35343
And the result is: Process 35343 attached wait4(2837,
I guess that it's waiting for process with PID: 2837 I also confirmed with running pgrep to find child processes for the main process (35343) pgrep -P 35343
The result was: 2837
So I started tracing the process with PID 2837 strace -p 2837
And the result was: rt_sigaction(SIGPIPE, NULL, {SIG_IGN, [PIPE], SA_RESTORER|SA_RESTART, 0x646fd74be6a0}, 8) = 0 rt_sigaction(SIGPIPE, {SIG_IGN, [PIPE], SA_RESTORER|SA_RESTART, 0x646fd74be6a0}, NULL, 8) = 0 poll([{fd=4, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 0) = 0 (Timeout) rt_sigaction(SIGPIPE, {SIG_IGN, [PIPE], SA_RESTORER|SA_RESTART, 0x646fd74be6a0}, NULL, 8) = 0 poll([{fd=4, events=POLLIN}], 1, 1000) = 0 (Timeout) rt_sigaction(SIGPIPE, NULL, {SIG_IGN, [PIPE], SA_RESTORER|SA_RESTART, 0x646fd74be6a0}, 8) = 0 rt_sigaction(SIGPIPE, {SIG_IGN, [PIPE], SA_RESTORER|SA_RESTART, 0x646fd74be6a0}, NULL, 8) = 0 poll([{fd=4, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 0) = 0 (Timeout) rt_sigaction(SIGPIPE, {SIG_IGN, [PIPE], SA_RESTORER|SA_RESTART, 0x646fd74be6a0}, NULL, 8) = 0 poll([{fd=4, events=POLLIN}], 1, 1000) = 0 (Timeout)
Obviously, it's trying to access a resource or something and it's timing out everytime. I tried to check the file descriptors for the PID 2837 ls -l /proc/2837/fd
And the result is: total 0 dr-x------ 2 myuser root 0 Dec 4 17:01 ./ dr-xr-x--- 7 myuser root 0 Dec 4 17:00 ../ lr-x------ 1 myuser myuser 64 Dec 4 17:01 0 -> pipe:[1136021968] l-wx------ 1 myuser myuser 64 Dec 4 17:01 1 -> pipe:[1136021969] l-wx------ 1 myuser myuser 64 Dec 4 17:01 2 -> pipe:[1136021970] lrwx------ 1 myuser myuser 64 Dec 4 17:01 3 -> socket:[1135965125] lrwx------ 1 myuser myuser 64 Dec 4 17:01 4 -> socket:[1136027676]
And I got stuck here and don't know what to do next. and I hope that someone could give me a help with this issue.
And the result is: Process 35343 attached wait4(2837,
I guess that it's waiting for process with PID: 2837 I also confirmed with running pgrep to find child processes for the main process (35343) pgrep -P 35343
The result was: 2837
So I started tracing the process with PID 2837 strace -p 2837
And the result was: rt_sigaction(SIGPIPE, NULL, {SIG_IGN, [PIPE], SA_RESTORER|SA_RESTART, 0x646fd74be6a0}, 8) = 0 rt_sigaction(SIGPIPE, {SIG_IGN, [PIPE], SA_RESTORER|SA_RESTART, 0x646fd74be6a0}, NULL, 8) = 0 poll([{fd=4, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 0) = 0 (Timeout) rt_sigaction(SIGPIPE, {SIG_IGN, [PIPE], SA_RESTORER|SA_RESTART, 0x646fd74be6a0}, NULL, 8) = 0 poll([{fd=4, events=POLLIN}], 1, 1000) = 0 (Timeout) rt_sigaction(SIGPIPE, NULL, {SIG_IGN, [PIPE], SA_RESTORER|SA_RESTART, 0x646fd74be6a0}, 8) = 0 rt_sigaction(SIGPIPE, {SIG_IGN, [PIPE], SA_RESTORER|SA_RESTART, 0x646fd74be6a0}, NULL, 8) = 0 poll([{fd=4, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 0) = 0 (Timeout) rt_sigaction(SIGPIPE, {SIG_IGN, [PIPE], SA_RESTORER|SA_RESTART, 0x646fd74be6a0}, NULL, 8) = 0 poll([{fd=4, events=POLLIN}], 1, 1000) = 0 (Timeout)
Obviously, it's trying to access a resource or something and it's timing out everytime. I tried to check the file descriptors for the PID 2837 ls -l /proc/2837/fd
And the result is: total 0 dr-x------ 2 myuser root 0 Dec 4 17:01 ./ dr-xr-x--- 7 myuser root 0 Dec 4 17:00 ../ lr-x------ 1 myuser myuser 64 Dec 4 17:01 0 -> pipe:[1136021968] l-wx------ 1 myuser myuser 64 Dec 4 17:01 1 -> pipe:[1136021969] l-wx------ 1 myuser myuser 64 Dec 4 17:01 2 -> pipe:[1136021970] lrwx------ 1 myuser myuser 64 Dec 4 17:01 3 -> socket:[1135965125] lrwx------ 1 myuser myuser 64 Dec 4 17:01 4 -> socket:[1136027676]
And I got stuck here and don't know what to do next. and I hope that someone could give me a help with this issue.
-
I have also noticed that "Gracefully finishing" processes have the same symptoms and they are not dying :/ 0 -
I have found the cause of the issue in case anyone have the same problem. It was a line in a PHP script that is using curl and failing while trying to resolve domain names. I commented out this line and the problem seems to be gone. curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );0 -
Hello :) I am happy to see you were able to resolve the issue. Thank you for updating us with the outcome. 0
Please sign in to leave a comment.
Comments
3 comments