[Catalyst] May be asynchronous communication between Catalyst applications

Bill Moseley moseley at hank.org
Sun Feb 24 17:19:04 GMT 2013


On Sun, Feb 24, 2013 at 8:16 AM, James R. Leu <jleu at mindspring.com> wrote:

> I do not have any suggestions about the App1 to App2 hand off
> but perhaps my technique for handling async/long running requests
> will help.
>
> I solved my async requirements by using Catalyst::Plugin::Cache
> and Catalyst::Plugin::RunAfterRequest.
>

Long running requests have to run somewhere, of course, and often running
in the Catalyst app is the easy solution and may work fine if you are not
running a busy site or expecting many concurrent users -- ever.

But, in general designing your web app in a way that you expect processes
to block for a long time is very risky.   You don't want to DoS your own
site.

It's all about the specifics, but long running processes are often resource
intensive, and when they run long users start reloading which users more
resources and just compounds the problem.  Soon you have an unresponsive
site.  Maybe you can manage or limit the number of long running web
processes in some way, but this is a problem that's already been solved.

Francisco gave very good advice.  Use a queue to decouple the web app from
the long-running jobs. You then have control over your resources -- workers
pull in work as they are free instead of stuffing work into web processes.
 Scaling is then trivial as it's just more workers.

It may seem like more work up front to set up but will making things like
this much easer -- and safer.


-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20130224/8ba39=
505/attachment.htm


More information about the Catalyst mailing list