Not symfony-specific, but you'll want to kick off some background process.
I'm not familiar with symfony's tooling for command-line scripts, but I think there is stuff you can use.
Then in your controller, you want something roughly like (assuming you're on a unixy host):
public function executeYourBackgroundTask(){
// first, you might want to create some kind of entry in a table to keep track of jobs.
// Imagine you've got a table to keep track of this stuff
$job = new Backgroundjob();
$job->user_id = $this->getUser()->getId();
$job->starttime = time();
$job->someArgument = $someArgument; //anything the job script needs for input.
$job->save();
$jobId = $job->getId();
//start a job in the background.
exec('php /path/to/your/background/script.php ' . $jobId .' &');
//your view should just tell the user "Your job is being processed, you'll be notified when it is done"
}
Your background process (in /path/to/your/background/script.php) should take the passed jobId, grab the job record, and use any stored inputs to run the job. When it's done grabbing data and stuffing it into the database, it should do set an endtime in the table (which marks the job as complete), and then do whatever you want to do to notify the user (send an email, or insert some kind of row into a messages table, etc)