0
votes

I'm running on Gearman 1.1.12 version. I have 2 PHP workers who are requested frequency ( about 60 times per minute ). By checking statistics i see that current number of workers are quite enough to do the job. ( The jobs waiting in queue for every worker in most cases are 0 ).

The problem is that, i have noticed about memory consumption. On every request to the worker, memory usage for that worker constantly grows it's about up to 25mb of memory in one minute ( 60 secs ) for each worker.

For example:

  1. 1 Request: 2Mb.
  2. 2 Request: 2.5Mb.
  3. 3 Request: 3Mb

And so on.

I'm unset every variable which is declared in that function before returning results but it seems that it also does not help..

Is it normal behavior? If it is, how i should deal with it? Kill these workers frequency with some script and create new one?

1

1 Answers

0
votes

If I understand correctly it is a normal behavior, when workers consume memory because they keep it and does not free it until the worker process gets restarted.

More: https://groups.google.com/forum/#!topic/gearman/gtkIZ0yFypY

Also I think that with it can be nicely dealt with using GearmanManager which is able to restart workers after some defined time interval.