PHP Classes

load balance at vm level

Recommend this page to a friend!

      PHP Classes blog  >  Distributing PHP proc...  >  All threads  >  load balance at vm level  >  (Un) Subscribe thread alerts  
Subject:load balance at vm level
Summary:gearman vs cloud load balancing
Messages:2
Author:Norm Katz
Date:2009-11-23 19:06:56
Update:2009-11-23 23:11:49
 

  1. load balance at vm level   Reply   Report abuse  
Picture of Norm Katz Norm Katz - 2009-11-23 20:28:23
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?

  2. Re: load balance at vm level   Reply   Report abuse  
Picture of Cesar D. Rodas Cesar D. Rodas - 2009-11-23 23:11:49 - In reply to message 1 from Norm Katz
Hello Norm,

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).

Best regards,