Comment 33 for bug 802850

Revision history for this message
Brian Aker (brianaker) wrote : Re: [Bug 802850] Gearman 100% cpu usage, workers in a loop (PHP, 0.22, 0.23)

Thanks, I've got a test case now that I believe tickles the bug.

Cheers,
 -Brian

On Oct 20, 2011, at 11:57 PM, Marc Easen wrote:

> Hi Brian,
>
> The test case I used was to overload the gearmand with more background
> jobs than the workers can process, in our case that was 600 requests in
> a 4 second period to 16 workers, where each worker took around 3 seconds
> on average to complete. After the workers had processed the backlog,
> gearmand was idling at 100% (in one test where I set gearmand's thread
> count to 5 it was idling 450%) and the PHP workers were idling at around
> 20-30% each. I hope this helps
>
> --
> You received this bug notification because you are subscribed to
> Gearman.
> https://bugs.launchpad.net/bugs/802850
>
> Title:
> Gearman 100% cpu usage, workers in a loop (PHP, 0.22, 0.23)
>
> Status in Gearman Server and Client Libraries:
> New
>
> Bug description:
> After some time, minutes to hours, with a slight load on the gearman
> server (~1 job/min), workers get lost in a loop (per strace) and
> gearmand eats up 100% cpu.
>
> Strace of a worker:
> getsockopt(7, SOL_SOCKET, SO_ERROR, [117528996916232192], [4]) = 0
> sendto(7, "\0REQ\0\0\0\36\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
> recvfrom(7, "\0RES\0\0\0\n\0\0\0\0", 8192, 0, NULL, NULL) = 12
> sendto(7, "\0REQ\0\0\0\4\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
> poll([{fd=7, events=POLLIN}], 1, 5000) = 1 ([{fd=7, revents=POLLIN}])
> getsockopt(7, SOL_SOCKET, SO_ERROR, [117528996916232192], [4]) = 0
> sendto(7, "\0REQ\0\0\0\36\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
> recvfrom(7, "\0RES\0\0\0\n\0\0\0\0", 8192, 0, NULL, NULL) = 12
> sendto(7, "\0REQ\0\0\0\4\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
> poll([{fd=7, events=POLLIN}], 1, 5000) = 1 ([{fd=7, revents=POLLIN}])
> getsockopt(7, SOL_SOCKET, SO_ERROR, [117528996916232192], [4]) = 0
> sendto(7, "\0REQ\0\0\0\36\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
> recvfrom(7, "\0RES\0\0\0\n\0\0\0\0", 8192, 0, NULL, NULL) = 12
> sendto(7, "\0REQ\0\0\0\4\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
> poll([{fd=7, events=POLLIN}], 1, 5000) = 1 ([{fd=7, revents=POLLIN}])
> getsockopt(7, SOL_SOCKET, SO_ERROR, [117528996916232192], [4]) = 0
> sendto(7, "\0REQ\0\0\0\36\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
> recvfrom(7, "\0RES\0\0\0\n\0\0\0\0", 8192, 0, NULL, NULL) = 12
> sendto(7, "\0REQ\0\0\0\4\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
> poll([{fd=7, events=POLLIN}], 1, 5000) = 1 ([{fd=7, revents=POLLIN}])
> getsockopt(7, SOL_SOCKET, SO_ERROR, [117528996916232192], [4]) = 0
> sendto(7, "\0REQ\0\0\0\36\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
> recvfrom(7, "\0RES\0\0\0\n\0\0\0\0", 8192, 0, NULL, NULL) = 12
> sendto(7, "\0REQ\0\0\0\4\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
> poll([{fd=7, events=POLLIN}], 1, 5000) = 1 ([{fd=7, revents=POLLIN}])
> getsockopt(7, SOL_SOCKET, SO_ERROR, [117528996916232192], [4]) = 0
> sendto(7, "\0REQ\0\0\0\36\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
> recvfrom(7, "\0RES\0\0\0\n\0\0\0\0", 8192, 0, NULL, NULL) = 12
> sendto(7, "\0REQ\0\0\0\4\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
> poll([{fd=7, events=POLLIN}], 1, 5000) = 1 ([{fd=7, revents=POLLIN}])
> ....
>
>
> Strace of gearmand:
>
>
> # strace -p 2820
> Process 2820 attached - interrupt to quit
> clock_gettime(CLOCK_MONOTONIC, {3794803, 727265822}) = 0
> epoll_wait(3,
>
> (... and nothing more.... )
>
>
> All workers are PHP based.
>
>
> # php --ri gearman
>
> gearman
>
> gearman support => enabled
> extension version => 0.8.0
> libgearman version => 0.22
> Default TCP Host => 127.0.0.1
> Default TCP Port => 4730
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/gearmand/+bug/802850/+subscriptions