Moodle

Backups take a long time due to too small chunk size in backuplib.php function backup_log_info

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Won't Fix
  • Affects Version/s: 1.9.4, 1.9.5
  • Fix Version/s: None
  • Component/s: Backup
  • Labels:
    None
  • Environment:
    Solaris 10, Mysql 5.0.54, PHP 5.2.4
  • Affected Branches:
    MOODLE_19_STABLE

Description

We have struggled with cron.php's automatic backups taking an inordinately long time. Like, many, MANY hours (40+ for one site).

There may be more than one thing going on here, but one performance improvement I made that helped dramatically was increasing the chunk size tenfold in backuplib.php function backup_log_info():

Snippet lines 1463-1468


function backup_log_info($bf,$preferences) {

global $CFG;

//Number of records to get in every chunk
// $recordset_size = 1000;
// CHANGE THIS to 10k:
$recordset_size = 10000;


I tried upping it to 100k but that did not significantly further improve performance, and also required an increase in PHP's max_memory configuration.

For courses with large logs – "Front Page" for example – there were hundreds of chunks. All these database calls were very time consuming.

I strongly recommend increasing the chunk size here. I hate to have to locally patch our builds for little things like this, so it would be great to see this pushed back to Moodle core.

Any comments on this topic are welcome! thanks

Activity

Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

People

Dates

  • Created:
    Updated:
    Resolved: