shakura / yii2-gearman

Gearman handler for PHP
MIT License
28 stars 29 forks source link

High CPU load by gearmand and worker processes #4

Open kazip opened 9 years ago

kazip commented 9 years ago

In method createLoop() of Application class, we should be able to increase the value of setTimeout Not it is $worker->setTimeout(10); - that is 10ms. So worker asks too frequent for new work from gearman, and that leads to high cpu load. I propose to increase this value to 1000 (that means 1s). When I set it to 1s, cpu load becomes low.

I will be great if we can set this value from outside (in the configuration).

DeskAgent commented 8 years ago

Looks like this has been implemented

https://github.com/shakura/yii2-gearman/commit/3c78e6fde4bc304f33fd64aeff38c015d8a14191