Load the load into the job into the job queue table and Command , regularly run by cron , which handles any work in the job queue table.
As processing continues during the task, you can update the task table so that the user can check and see the progress (for example, you could have an ajax progress bar) and find out when the task will be completed.
This way you also remove the download from processing, and you can control how many jobs are processed at once. Having long runs of jobs directly from user input without using a throttling system / queues is a great way to open yourself up to a denial of service attack ...
source share