If you deploy your PHP app in a cloud (like Joyent or AppLogic) and have a load balancer that can distribute requests to apache VMs What advantage would gearman have over these solutions? Seems like if the cloud load balancer works well, it's the least expensive solution from a coding standpoint, so it's worth testing first. Can you provide a real-world example of an app that requires the lower-level control that gearman offers?

First, by having a well-distributed application over the cloud you can handle a lot of visitors at once, but can't have background tasks.

Background tasks are very important, there are a lot of tasks that are expensive or take a lot of time, for instance:

* Distributed crawler (as I showed on the blog post)

* Converting a video from any format to FLV (using ffmpeg probably)

* Text to speech (using Festival)

* Compressing large files

* Generate PDF from some information

* Execute large queries, i.e compute the Ranking of our users based on his activities on the site

Synchronous tasks are useful to delegate work to other machines that are prepared to handle some sort of processing, by doing this, you have a lightweight PHP client on your app server, and it is less error prone in some way. I think, it just worth if you're going to use resources from application written in another programming language (C, C++, Perl, etc), if you want to avoid Embedding or rewrite something. Some ideas are,

* Grammar and spell checker

* Spam detector, using to Spamassassin

* Search Engine, using Sphinx (The C library is much faster than the Pure PHP implementation).