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
12
votes
1 answer

Resque or Gearman - choosing the right tool for background jobs

We are developing a web application wherein with about 50% of write requests, we end up pushing data to multiple data stores and inserting and updating significant number of records in those data stores. To improve the response time, we want to…
Nishith
  • 268
  • 3
  • 9
11
votes
3 answers

Gearman , php extension problem : Class 'GearmanWorker' not found in .. using terminal but works on browser

I've installed gearman on ubuntu 10.04 recently and installed it's pecl extension. Now , when I run a php file in the browser that contains : $client = new GearmanWorker(); die(var_Dump($client)); I get object(GearmanWorker)#1 (0) { } but when…
Naughty.Coder
  • 3,922
  • 7
  • 32
  • 41
11
votes
2 answers

Valid Architecture for a Message Queue & Worker System in PHP?

I'm trying to wrap my head around the message queue model and jobs that I want to implement in a PHP app: My goal is to offload messages / data that needs to be sent to multiple third party APIs, so accessing them doesnt slow down the client. So…
kzap
  • 1,411
  • 13
  • 20
10
votes
5 answers

Gearman with multiple servers and php workers

I'm having a problem with gearman workers running on multiple servers which i can't seem to solve. The problem occurs when a worker server is taken offline, rather than the worker process being cancelled, and causes all other worker processes to…
Andy Burton
  • 566
  • 6
  • 12
10
votes
1 answer

Gearman & PHP: Proper Way For a Worker to Send Back a Failure

The PHP docs are a bit fuzzy on this one, so I'm asking it here. Given this worker code: addServer(); $gmworker->addFunction("doSomething", "doSomethingFunc"); while($gmworker->work()); function…
mellowsoon
  • 22,273
  • 19
  • 57
  • 75
10
votes
3 answers

Is it possible to empty a job queue on a Gearman server

Is it possible to empty a job queue on a Gearman server? I am using the python driver for Gearman, and the documentation does not have any information about emptying queues. I would imagine that this functionality should exist, possibly, with a…
daniyalzade
  • 981
  • 3
  • 8
  • 19
10
votes
2 answers

Gearman vs. Redis when writing PHP batch processors

When writing a batch processor in PHP (as in, it will obviously have to be cron-ed), what are the practical differences between using Gearman and simply storing data to be processed in Redis? My observations thus far are that while Gearman is…
Alexander Trauzzi
  • 7,277
  • 13
  • 68
  • 112
9
votes
1 answer

How to get status of Gearman Jobs by their uniq id?

I need to get status of Gearman jobs by these uniq id, not by open handlers, as desribed every place I seen Is it possible? using in python-gearman v. 2... Thanks for assistance!
Michael_XIII
  • 175
  • 1
  • 14
9
votes
2 answers

Task Scheduling with complex dependencies

I'm looking for a way of scheduling tasks where a task starts once several previous tasks have completed. I have several hundred "collector" processes which collect data from a variety of sources and dump it to a database. Once these have finished…
Crashthatch
  • 1,283
  • 2
  • 13
  • 20
9
votes
1 answer

Gearman vs ZeroMQ

Has someone some feedback about distributed architectures with these engines? Which is the best, or in which cases which is the best election? Regards!
Christian
  • 93
  • 1
  • 3
9
votes
4 answers

Queuing systems - what is a good way to start up multiple workers?

How have you set-up one or more worker scripts for queue-oriented systems? How do you arrange to startup - and restart if necessary - worker scripts as required? (I'm thinking about such tools as init.d/, Ruby-based 'god', DJB's Daemontools, etc,…
Alister Bulman
  • 34,482
  • 9
  • 71
  • 110
9
votes
3 answers

asynchronous processing with PHP - one worker per job

Consider a PHP web application whose purpose is to accept user requests to start generic asynchronous jobs, and then create a worker process/thread to run the job. The jobs are not particularly CPU or memory intensive, but are expected to block on…
Josh Johnson
  • 8,832
  • 4
  • 25
  • 31
8
votes
5 answers

How to install libuuid on Mac OS X?

I'm trying to compile gearman-0.28 on Mac, but encountered the following error: configure: error: Unable to find libuuid I don't know how to install libuuid on Mac, my Mac is 10.7.2 version. Any one can help me? Thanks in advance.
ciphor
  • 8,018
  • 11
  • 53
  • 70
8
votes
3 answers

Web UI for Gearman or Alternatives for PHP Job Queue

We develop a suite of PHP SASS applications and we use Gearman to process tasks in the background both synchronously and asynchronously. We love everything Gearman has to offer but we've beginning to find the administration of the queue to becoming…
xzyfer
  • 13,937
  • 5
  • 35
  • 46
8
votes
1 answer

Supervisord spawns only 1 instance

I have the following problem: I want to run a php script as a gearman worker, or as 5 workers to be precise. This is my supervisord.conf-addition: [program:gearman-test-worker] process_name=%(program_name)s_%(process_num)02d command=/usr/bin/php…
Martin Müller
  • 2,565
  • 21
  • 32
1
2
3
32 33