Comment 4 for bug 802850

Revision history for this message
Artur Bodera (abodera) wrote : Re: Gearman 100% cpu usage, workers in a loop (PHP, 0.22)

Just compiled and installed 0.23 daemon,
recompilled pecl extension,
restarted everything

! same thing.

Below is strace of one of the workers.

I have noticed that "THE LOOP" happens when the machine has an avg load of 10+. It does not occur when the machine has no load (i.e. <1) - then the gearman daemon behaves nicely, idle workers have cpu time < 1s in 1h of waiting.

Unfortunatelly as soon as some cpu-intensive work kicks in, one of "gearman -d" threads starts eatung up the CPU resulting in avg load > 30.

sendto(12, "\0REQ\0\0\0\4\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
poll([{fd=12, events=POLLIN}], 1, 5000) = 1 ([{fd=12, revents=POLLIN}])
getsockopt(12, SOL_SOCKET, SO_ERROR, [823261839558180864], [4]) = 0
sendto(12, "\0REQ\0\0\0\36\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
sendto(12, "\0REQ\0\0\0\4\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
poll([{fd=12, events=POLLIN}], 1, 5000) = 1 ([{fd=12, revents=POLLIN}])
getsockopt(12, SOL_SOCKET, SO_ERROR, [823261839558180864], [4]) = 0
sendto(12, "\0REQ\0\0\0\36\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
sendto(12, "\0REQ\0\0\0\4\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
poll([{fd=12, events=POLLIN}], 1, 5000) = 1 ([{fd=12, revents=POLLIN}])
getsockopt(12, SOL_SOCKET, SO_ERROR, [823261839558180864], [4]) = 0
sendto(12, "\0REQ\0\0\0\36\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
sendto(12, "\0REQ\0\0\0\4\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
poll([{fd=12, events=POLLIN}], 1, 5000) = 1 ([{fd=12, revents=POLLIN}])
getsockopt(12, SOL_SOCKET, SO_ERROR, [823261839558180864], [4]) = 0
sendto(12, "\0REQ\0\0\0\36\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
sendto(12, "\0REQ\0\0\0\4\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
poll([{fd=12, events=POLLIN}], 1, 5000) = 1 ([{fd=12, revents=POLLIN}])
getsockopt(12, SOL_SOCKET, SO_ERROR, [823261839558180864], [4]) = 0
sendto(12, "\0REQ\0\0\0\36\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
recvfrom(12, "\0RES\0\0\0\n\0\0\0\0", 8192, 0, NULL, NULL) = 12
sendto(12, "\0REQ\0\0\0\4\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
poll([{fd=12, events=POLLIN}], 1, 5000) = 1 ([{fd=12, revents=POLLIN}])
getsockopt(12, SOL_SOCKET, SO_ERROR, [823261839558180864], [4]) = 0
sendto(12, "\0REQ\0\0\0\36\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
recvfrom(12, "\0RES\0\0\0\n\0\0\0\0\0RES\0\0\0\n\0\0\0\0\0RES\0\0\0\n"..., 8192, 0, NULL, NULL) = 60
sendto(12, "\0REQ\0\0\0\4\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
poll([{fd=12, events=POLLIN}], 1, 5000^Cto(12, "\0REQ\0\0\0\36\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0 <unfinished ...>
Process 30713 detached