Commit 7f8c4418 authored by Nicolas Wavrant's avatar Nicolas Wavrant

Do not parallelize calculus when the heaviest task is IO

Otherwise, performances get awful on HDD, and not far better on SSD.
parent 3ab878d8
...@@ -194,7 +194,7 @@ class Recipe(GenericSlapRecipe, Notify, Callback): ...@@ -194,7 +194,7 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
if [ -e %(backup_signature)s ]; then if [ -e %(backup_signature)s ]; then
cd $BACKUP_DIR cd $BACKUP_DIR
find -type f ! -name backup.signature ! -wholename "./rdiff-backup-data/*" -print0 | xargs -P4 -0 sha256sum | LC_ALL=C sort -k 66 > ../proof.signature find -type f ! -name backup.signature ! -wholename "./rdiff-backup-data/*" -print0 | xargs -0 sha256sum | LC_ALL=C sort -k 66 > ../proof.signature
cmp backup.signature ../proof.signature || SUCCEEDED=false cmp backup.signature ../proof.signature || SUCCEEDED=false
diff -ruw backup.signature ../proof.signature > ../backup.diff diff -ruw backup.signature ../proof.signature > ../backup.diff
# XXX If there is a difference on the backup, we should publish the # XXX If there is a difference on the backup, we should publish the
......
...@@ -147,7 +147,7 @@ recipe = hexagonit.recipe.download ...@@ -147,7 +147,7 @@ recipe = hexagonit.recipe.download
ignore-existing = true ignore-existing = true
url = ${:_profile_base_location_}/template/kvm-import.sh.jinja2 url = ${:_profile_base_location_}/template/kvm-import.sh.jinja2
filename = kvm-import.sh.jinja2 filename = kvm-import.sh.jinja2
md5sum = 926a11421921c29f91fae8240bbcf585 md5sum = cd0008f1689dfca9b77370bc4d275b70
download-only = true download-only = true
mode = 0755 mode = 0755
...@@ -165,7 +165,7 @@ recipe = hexagonit.recipe.download ...@@ -165,7 +165,7 @@ recipe = hexagonit.recipe.download
ignore-existing = true ignore-existing = true
url = ${:_profile_base_location_}/template/kvm-export.sh.jinja2 url = ${:_profile_base_location_}/template/kvm-export.sh.jinja2
filename = kvm-export.sh.jinja2 filename = kvm-export.sh.jinja2
md5sum = 22bd2e0c8fdb39a764a14c403a3bd752 md5sum = c18e958bf374d5fa35dbb952686595fb
download-only = true download-only = true
mode = 0755 mode = 0755
......
...@@ -25,5 +25,5 @@ $QMP_CLIENT --socket {{ socket_path }} --drive-backup $BACKUP_DIR/$BACKUP_FILE ...@@ -25,5 +25,5 @@ $QMP_CLIENT --socket {{ socket_path }} --drive-backup $BACKUP_DIR/$BACKUP_FILE
echo "Compressing backup..." echo "Compressing backup..."
{{ gzip_binary }} --force --rsyncable $BACKUP_DIR/$BACKUP_FILE {{ gzip_binary }} --force --rsyncable $BACKUP_DIR/$BACKUP_FILE
cd $BACKUP_DIR && find -type f ! -name backup.signature -print0 | xargs -P4 -0 sha256sum | LC_ALL=C sort -k 66 > backup.signature cd $BACKUP_DIR && find -type f ! -name backup.signature -print0 | xargs -0 sha256sum | LC_ALL=C sort -k 66 > backup.signature
...@@ -9,7 +9,7 @@ umask 077 ...@@ -9,7 +9,7 @@ umask 077
write_backup_proof () { write_backup_proof () {
cd {{ directory['backup'] }} cd {{ directory['backup'] }}
find -type f ! -name backup.signature ! -wholename "./rdiff-backup-data/*" -print0 | xargs -P4 -0 sha256sum | LC_ALL=C sort -k 66 > {{ directory['srv'] }}/proof.signature find -type f ! -name backup.signature ! -wholename "./rdiff-backup-data/*" -print0 | xargs -0 sha256sum | LC_ALL=C sort -k 66 > {{ directory['srv'] }}/proof.signature
diff -ruw {{ directory['backup'] }} {{ directory['srv'] }}/proof.signature > {{ directory['srv'] }}/backup.diff diff -ruw {{ directory['backup'] }} {{ directory['srv'] }}/proof.signature > {{ directory['srv'] }}/backup.diff
} }
......
...@@ -31,7 +31,7 @@ md5sum = 9db9957f452bda370cb2d5cc2e833e85 ...@@ -31,7 +31,7 @@ md5sum = 9db9957f452bda370cb2d5cc2e833e85
[template-runner-export-script] [template-runner-export-script]
filename = template/runner-export.sh.jinja2 filename = template/runner-export.sh.jinja2
md5sum = 2e96b9daa5cd20fc77e9573a9ce3fe52 md5sum = 86a429492dba25364f6ec2b318ba1f85
[instance-runner-export] [instance-runner-export]
filename = instance-runner-export.cfg.in filename = instance-runner-export.cfg.in
......
...@@ -60,7 +60,7 @@ if [ -d {{ directory['backup'] }}/runner/software ]; then ...@@ -60,7 +60,7 @@ if [ -d {{ directory['backup'] }}/runner/software ]; then
rm {{ directory['backup'] }}/runner/software/* rm {{ directory['backup'] }}/runner/software/*
fi fi
cd {{ directory['backup'] }} && find -type f ! -name backup.signature -print0 | xargs -P4 -0 sha256sum | LC_ALL=C sort -k 66 > backup.signature cd {{ directory['backup'] }} && find -type f ! -name backup.signature -print0 | xargs -0 sha256sum | LC_ALL=C sort -k 66 > backup.signature
# Check that export didn't happen during backup of instances # Check that export didn't happen during backup of instances
tmp_backup_sum=$(mktemp -p {{ directory['tmp'] }}) tmp_backup_sum=$(mktemp -p {{ directory['tmp'] }})
......
...@@ -51,7 +51,7 @@ mode = 0644 ...@@ -51,7 +51,7 @@ mode = 0644
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/pbsready-import.cfg.in url = ${:_profile_base_location_}/pbsready-import.cfg.in
output = ${buildout:directory}/pbsready-import.cfg output = ${buildout:directory}/pbsready-import.cfg
md5sum = 5d5e4ad35c1a97ea5f7a15a4f5f766a8 md5sum = af85dfe8d281f3458be3de46f8e6a2b4
mode = 0644 mode = 0644
[pbsready-export] [pbsready-export]
......
...@@ -72,7 +72,7 @@ proof-signature-file = $${basedirectory:backup}/proof.signature ...@@ -72,7 +72,7 @@ proof-signature-file = $${basedirectory:backup}/proof.signature
input = inline: input = inline:
#!/${bash:location}/bin/bash #!/${bash:location}/bin/bash
cd $${directory:backup} cd $${directory:backup}
find -type f ! -name backup.signature ! -wholename "./rdiff-backup-data/*" -print0 | xargs -P4 -0 sha256sum | LC_ALL=C sort -k 66 > $${:proof-signature-file} find -type f ! -name backup.signature ! -wholename "./rdiff-backup-data/*" -print0 | xargs -0 sha256sum | LC_ALL=C sort -k 66 > $${:proof-signature-file}
diff -ruw backup.signature $${:proof-signature-file} > $${:diff-file} diff -ruw backup.signature $${:proof-signature-file} > $${:diff-file}
output = $${rootdirectory:bin}/post-notification-run output = $${rootdirectory:bin}/post-notification-run
mode = 0700 mode = 0700
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment