Questions tagged [gearman]

Gearman is a system to farm out work to other machines, dispatching function calls to machines that are better suited to do work, to do work in parallel, to load balance lots of function calls, or to call functions between languages.

Gearman is an open source application framework originally written in Perl by Brad Fitzpatrick. Brian Aker and Eric Day rewrote the framework in C.

Gearman is designed to distribute appropriate computer tasks to multiple computers, so large tasks can be done more quickly.

In some cases, load balancing rather than raw speed may be the main goal; a Web server, for instance, could use Gearman to send tasks for which it is not optimized to another computer (which may be running on a different architecture, using another operating system, or loaded with a computer language better suited to a particular operation).

Job server is available in three languages:

  • C/C++
  • Java
  • Perl

Client & Worker APIs are available in following languages:

  • libgearman (C)
  • Shell
  • Perl
  • Nodejs
  • PHP
  • Python
  • Java
  • Databases
  • JMS
  • C# / .NET

Some of the use cases provided at the web site:

Resources

IRC channel is #gearman on Freenode.

484 questions
72
votes
2 answers

Rabbitmq or Gearman - choosing a jobs queue

At work, we need to build a jobs server for things like sending emails, building PDFs, crunching some data, etc. Obviously, we'd like to build on some sort of generic queueing system. I'm familiar with Gearman, and that this is exact problem that…
brianz
  • 7,268
  • 4
  • 37
  • 44
43
votes
12 answers

Stopping gearman workers nicely

I have a number of Gearman workers running constantly, saving things like records of user page views, etc. Occasionally, I'll update the PHP code that is used by the Gearman workers. In order to get the workers to switch to the new code, I the…
Karptonite
  • 1,490
  • 2
  • 14
  • 30
36
votes
3 answers

Have Supervisord Periodically restart child processes

I am using Supervisor (3.0a12) on ubuntu 12.04 to manage php gearman workers. Sometimes the workers get caught in a weird state where they use tons of cpu and ram. While I am figuring this issue out I thought it would be nice to have Supervisor…
dm03514
  • 54,664
  • 18
  • 108
  • 145
28
votes
1 answer

Starting multiple upstart instances automatically

We use PHP gearman workers to run various tasks in parallel. Everything works just fine, and I have silly little shell script to spin them up when I want them. Being a programmer (and therefore lazy), I wanted to see if I could spin these up via…
mkgrunder
  • 941
  • 1
  • 7
  • 13
26
votes
9 answers

Any way to access Gearman administration?

I want to be able to query a gearman server to determine how many instances of a worker I have running (basically I want to make sure that RunTaskA is available and RunTaskB is available if there are no workers handling those tasks, I want to be…
Mitch Dempsey
  • 38,725
  • 6
  • 68
  • 74
23
votes
1 answer

Gearman slow when client sends large payload

I have an issue using Gearman that is slow to transfer tasks to workers when I send it large payloads via the Gearman PHP extension. In fact, we don't find the payload to be that big (it's 30MB). Everything (PHP, Gearman, node) runs locally for now,…
MaxiWheat
  • 6,133
  • 6
  • 47
  • 76
15
votes
7 answers

How can I get the number of queued jobs of a particular type in gearman?

I have a number of gearman clients sending a job, say job1. $client = new GearmanClient(); $client->addServer(); $client->doBackground('job1', 'workload'); It takes, say 10 seconds to process this job. I want to track how many 'job1' jobs are…
Coffee Bite
  • 4,956
  • 5
  • 33
  • 38
14
votes
2 answers

Remove all Gearman jobs from the Gearman Job Server

Is there a way to remove all Gearman jobs from the Gearman Job Server? I have a PHP application that runs Gearman jobs in the background. For my unit tests I need to ensure that a) there are no jobs waiting for a worker that executes it and b) that…
stofl
  • 2,950
  • 6
  • 35
  • 48
13
votes
3 answers

Any Gearman tutorial?

I am looking for a comprehensive Gearman tutorial (preferably with the PHP API). I am trying to understand the flow of the process. I set the daemon running, create clients and workers, but how do I handle them with Gearman (like add/remove workers…
johnjohn
  • 4,221
  • 7
  • 36
  • 46
13
votes
2 answers

Gearman gearadmin command line tool status output meaning

I am unable to find any documentation on the meaning of the gearadmin command line tool with the '--status' option. What is the meaning of the three numbers found after the worker function name ? For example, then I run this command: gearadmin…
newtonick
  • 135
  • 1
  • 1
  • 5
13
votes
2 answers

whats the difference between a task and do

When looking inside the php gearman docs I see that there are task and do, both of them have background and non background and they also all have high and low and normal. Can anyone clarify these? I'm just really confused about the difference.
WojonsTech
  • 1,277
  • 1
  • 13
  • 28
12
votes
1 answer

Error conditions and retries in gearman?

Can someone guide me on how gearman does retries when exceptions are thrown or when errors occur? I use the python gearman client in a Django app and my workers are initiated as a Django command. I read from this blog post that retries from error…
Cherian
  • 19,107
  • 12
  • 55
  • 69
12
votes
1 answer

Compiled PHP extension is not valid

I am trying to install the gearman PHP extension on Ubuntu 10.04 with PHP pinned to 5.2, but PHP is telling me it's not a valid Zend extension. There are no errors when compiling from source (or installing via pecl), but after it's installed, PHP…
Brian
  • 15,599
  • 4
  • 46
  • 63
12
votes
3 answers

Running Gearman Workers in the Background

I'm using Ubuntu Natty with PHP 5.3.8. I just got Gearman working on my server. I did a few tests with some scripts I got off the PHP Manual, and everything works ok. However, I'd like to know if there's a way I can run the worker in the background,…
ObiHill
  • 11,448
  • 20
  • 86
  • 135
12
votes
1 answer

What's best practice for HA gearman job servers

From gearman's main page, they mention running with multiple job servers so if a job server dies, the clients can pick up a new job server. Given the statement and diagram below, it seems that the job servers do not communicate with each other. Our…
Paul DelRe
  • 4,003
  • 1
  • 24
  • 26
1
2 3
32 33