Gearman is a lightweight, high-performance solution for farming out processing work from one machine to another. I’m currently looking at using Gearman as a key part of the architecture of a new web API that I’m doing the R&D for. (I’ll go into why I need something like this, and why I’ve chosen Gearman in particular, another day).

Getting Gearman up and running on Ubuntu 9.10 (Karmic Koala) is very straight-forward and only takes a few minutes, but oddly not clearly documented on Gearman’s own wiki at the time of writing.

  1. Add “ppa:gearman-developers/ppa” as a software source.
  2. sudo apt-get install gearman-job-server
  3. sudo apt-get install libgearman-dev
  4. sudo apt-get install uuid-dev
  5. pecl install “channel://”
  6. Add a gearman.ini to /etc/php5/conf.d, with “” as the contents
  7. sudo /etc/init.d/apache2 restart
  8. Check phpinfo() to make sure gearman extension loaded

You’ll find that the gearmand process is already up and running, and listening on port 4730 on localhost. All you need to do now is to write some code to take advantage of it 🙂

No Comments

  1. Martin Fjordvald says:
    February 26th, 2010 at 1:27 pm

    While farming out processing work is excellent, another strong point is that it’s language independent. So you can use Gearman to have PHP send background jobs to C.

    Deciding to use Gearman is one of the better decisions I made this year.

  2. Gear up your PHP Apps with GearMan | says:
    September 30th, 2011 at 5:07 am

    […] – […]

  3. Gear up your PHP Apps with GearMan | says:
    September 30th, 2011 at 5:07 am

    […] – […]

This Month

February 2010
« Jan   Jul »