Scaling like a pro
      with
   Gearman
Me?


Web developer at... well yet another startup!

Contributor to Symfony web framework

Find me on Twitter @kertz
My idea of scaling...
What is Gearman?

A Job server

Client API

Worker API

...and lots of client & worker API libraries
What’s a job server?


Manages the communication between clients
and workers
Client & Worker

The client asks the worker to do a specific job

The worker does what the client asks, oh yeah!

More importantly it’s language independent!

PHP Gearman extension
How does it work?
A Simple Worker




     Worker
Calling the worker




       Client
Making it work

Start gearmand in your terminal

You can use -vvv for verbose mode

Run the worker and client

Foreground and background jobs
Status of Work


Numerator/Denominator(X of Y)

Store the status in memcache/APC

Store in MySQL, Drizzle
Knowing The Status




      Worker
Knowing The Status




       Client
Knowing The Status




       Result
Parallel Tasks




     Client
Callbacks




  Client
Callbacks




  Worker
Prioritize Work




Note: Separate queues for each priority level
Managing Worker

cron

Gearman Manager
https://github.com/brianlmoon/GearmanManager


supervisord
In Retrospect

Easily manage client-worker relationship

Language independent (PHP, C, Perl etc.)

Parallel, Callbacks, Priorities

Managing Workers
Questions?

Scale like a pro with Gearman