[cgiapp] Tasks after fork()'ing a CGI::Application
Gurunandan R. Bhat
guru at informationmatters.in
Mon Aug 10 11:59:26 EDT 2009
On Mon, 2009-08-10 at 11:18 -0400, Michael Peters wrote:
> I would actually suggest that you don't fork your web process to do background
> tasks. The problem is that your web processes are generally much heavier than
> you need which means wasted resources. It also can cause scalability concerns if
> you suddenly have lots of background tasks to perform. I'd suggest you look into
> having a dedicated job queue. You could use one of the existing frameworks like
> Gearman or TheSchwartz, or you could write you own using something like POE or
> Proc::Daemon+Parallel::ForkManager.
>
Thanks. I did seriously consider TheSchwartz and gearman. I have two
features that I want to implement: First, I want to pass some feedback
to the user who queued the task indicating progress. Second, I must be
able to schedule it at a future time. I am currently using Schedule::At
to do this. Again both are fragile and as you correctly pointed out,
will suffer when scaled.
I had not looked at POE so I will now.
Thanks once again
Regards
More information about the cgiapp
mailing list