php - Increase CPU Usage Of Gearman Worker Over Time -


i running gearman worker distribute background jobs multiple workers. monitor background jobs , restaart upon crash, using supervisord process management system.

the gearman worker code pretty simple official example:

$worker = new gearmanworker(); $worker->addserver($config["gearman.host"],$config["gearman.port"]); $worker->addfunction("config_job", "run_config_job");  while ($worker->work()); 

for workers, expecting, during job execution cpu usage high, after completion if become low during waiting time. interestingly, long running processes, contains increased cpu usage on time.

does has idea main reason behind incremental cpu usage on time is?

also, tasks run on aws ec2 small instances, how many workers can run in parallel in single workers-only instance on average?

php not particularly designed use case, may prudent restart workers on regular interval. if not cleaning after each job, may running memory leak.

small instances have single core, means run 1 job @ time. however, if jobs need wait reason, api response, may able have several jobs running @ same time.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -