I have an instance that is severely affected by long times and timeouts while backing up and restoring courses.
The backup file itself is only 2 MB, but it does have a large number of quizzes and question banks (around 120; with 15 Qs per quiz and ~30 Qs per question bank), and there are many courses with this format or half the number of quizzes. It can end up trying to restore for an hour before it times out. Sometimes the restore occurs in the background even prior to a timeout, if I open another browser and log in to check (without the browser or incognito window, the user is stuck waiting and cannot navigate around the LMS while restoring). However, it also occurs with brand new courses with one quiz in it.
Some solutions that have been attempted include increasing timeout limits, upgrading from 2.2 to 2.4 for improved caching, deleting quizzes and question banks, and various troubleshooting and config changes.
Here is a Moodle bug that looks related https://tracker.moodle.org/browse/MDL-29439.
If there is any advice or fixes, suggestions are welcome as this issue has been getting progressively worse.