This is how I understand the problem. Correct me if I'm wrong.
When Moodle does a backup it runs through the file core_backup_progress.class.php In that file it sets up the progress meter. It then gives a constant called TIME_LIMIT_WITHOUT_PROGRESS. hard coded to 120
it then uses that constant in the progress() function
So if the progress bar doesn't get updated in 2 minutes, it times out and ends the script.
when creating a zip file, backup first makes the layout for the .zip in the temp directory under a long ugly folder name. This folder is used as the zip structure. During backup everything goes fine until it is time to finish the .zip file with the close() function. This function works very slowly, so if there are too many files or too big of files to process in 2 minutes it will run into the hard coded 120 second limit and time out with an error like:
PHP Fatal error: Maximum execution time of 120 seconds exceeded in \\lib\\filestorage
zip_archive.php on line 218
the part that times when zip_archive.php runs it's close() function. Inside this function, no progress updates are being sent out. I placed a set_time_limit(0); before the close function, and now everything works great.
$res = $this->za->close();
Let me know if there is anything I'm not grasping. Thanks!