surveys.com.cn
Moodle 还原课程时对于大的备份档无法顺利完成
  • 提交:天一
  • 时间:08-03-07 21:42
  • 更新:08-03-07 21:42
Moodle 还原课程时对于大的备份档无法顺利完成
最近准备将Moodle系统移植到效能较好服务器(IBM xServer),但对于档案超过400M的备份档一直无法成功。
  1. 将备份档直接ftp到server上,以免需重设最大上传容量。
  2. 更改一些timeout时间仍无法解决。
  3. 找寻moodle官方网站有无同样问题;在http://moodle.org/mod/forum/discuss.php?d=86281 找到相同的问题。
  4. http://tracker.moodle.org/browse/MDL-9290提供修正方法。 We have resolved the problem
    - commenting out the call to backup_flush() of every StartElement... and
    - including the code marked with + in the file restorelib.php at the end of the function restore_read_xml(...)

    + $lasttime = time(); // crmas
    while ($data = fread($fp, 4096) and !$moodle_parser->finished) {
    + if ((time() - $lasttime) > 5) {
    + $lasttime = time();
    + backup_flush(1);
    + }
    xml_parse($xml_parser, $data, feof($fp))
    or die(sprintf("XML error: %s at line %d",
    xml_error_string(xml_get_error_code($xml_parser)),
    xml_get_current_line_number($xml_parser)));
    }
    fclose($fp);

    1. 批注掉backup_flush() 测试后发现就不会让客户端CPU使用率一直在100%。
    2. 但如同第3点所提,并不见得会成功;
    3. 观察还原过程服务器内存使用量,发现若memory_limit设得太低仍无法成功,改进方法在php.ini中设定memory_limit 或是在backup/restore.php将raise_memory_limit("192M")调高即可,我调到512M才正常。
    4. 此问题在moodle2.0将会被修正

文章推荐

    Loading...

人气排行

    Loading...
[ 简体中文 ] [ 简改蓝 ] 管理模式
Copyright ©2005 - 2008 www.emoodle.org
Processed in 0.008(s) Powered by Hutula 1.0

浙ICP备08007391号-1