Backup and restore

Spawn multiple threads during automated backups

 
 
Picture of Jeff White
Spawn multiple threads during automated backups
 

From how the Moodle seems to work currently is the cronjob running the automated backups only uses a single thread and can only use one cpu core (please correct me if I am wrong). Since most systems now run at least 4-8 course wouldn't it be more efficient for the backup process to start a thread for multiple courses? Lets say start a thread for 4-8 courses at a time? That way the server can use its multiple cores to run the back up process? This is of course assuming the database is robust enough to keep up with multiple backups occurring at the same time. It would be interesting triggering the back up processes on other Apache servers for environments on cluster. 

 

Thoughts? 

 
Average of ratings: -
Picture of Marcus Green
Re: Spawn multiple threads during automated backups
Group Particularly helpful Moodlers

Moodle is written in PHP which does not have native support for multiple threads.

 
Average of ratings: -
Picture of Jeff White
Re: Spawn multiple threads during automated backups
 

Hi Marcus,

I did some quick googling and found thing like pcntl_fork some other methods out there. Would Moodle consider doing things like this or would it wait till a release of php that more readily support multithreading. 

 
Average of ratings: -
Picture of Marcus Green
Re: Spawn multiple threads during automated backups
Group Particularly helpful Moodlers

pcntl_fork is not available in Windows and not available in a web environment which would limit its applicability.

 
Average of ratings: -