For this type of thing I find it's better to use a backend daemon instead of running the process directly from the web server. Use something simple like Proc::Daemon and have it monitor a queue file or database table, and fork off a process to run the requested task. That should work easily on most platforms.