On Sun, Feb 24, 2013 at 8:16 AM, James R. Leu <[email protected]> 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 [email protected]
_______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
