ci(benchmark): Benchmark vm before n8n benchmark (#10859)

This commit is contained in:
Tomi Turtiainen 2024-09-17 18:36:46 +03:00 committed by GitHub
parent c43aef1a26
commit aa283b7554
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 0 deletions

View file

@ -37,6 +37,18 @@ else
sudo chown -R "$CURRENT_USER":"$CURRENT_USER" /n8n sudo chown -R "$CURRENT_USER":"$CURRENT_USER" /n8n
fi fi
### Remove unneeded dependencies
# TTY
sudo systemctl disable getty@tty1.service
sudo systemctl disable serial-getty@ttyS0.service
# Snap
sudo systemctl disable snapd.service
sudo apt remove snapd
# Unattended upgrades
sudo systemctl disable unattended-upgrades.service
# Cron
sudo systemctl disable cron.service
# Include nodejs v20 repository # Include nodejs v20 repository
curl -fsSL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh curl -fsSL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh
sudo -E bash nodesource_setup.sh sudo -E bash nodesource_setup.sh

View file

@ -78,6 +78,12 @@ async function runBenchmarksOnVm(config, benchmarkEnv) {
const bootstrapScriptPath = path.join(scriptsDir, 'bootstrap.sh'); const bootstrapScriptPath = path.join(scriptsDir, 'bootstrap.sh');
await sshClient.ssh(`chmod a+x ${bootstrapScriptPath} && ${bootstrapScriptPath}`); await sshClient.ssh(`chmod a+x ${bootstrapScriptPath} && ${bootstrapScriptPath}`);
// Benchmarking the VM
const vmBenchmarkScriptPath = path.join(scriptsDir, 'vm-benchmark.sh');
await sshClient.ssh(`chmod a+x ${vmBenchmarkScriptPath} && ${vmBenchmarkScriptPath}`, {
verbose: true,
});
// Give some time for the VM to be ready // Give some time for the VM to be ready
await sleep(1000); await sleep(1000);

View file

@ -0,0 +1,13 @@
#!/bin/bash
# Install fio
sudo apt-get -y install fio > /dev/null
# Run the disk benchmark
fio --name=rand_rw --ioengine=libaio --rw=randrw --rwmixread=70 --bs=4k --numjobs=4 --size=1G --runtime=30 --directory=/n8n --group_reporting
# Remove files
sudo rm /n8n/rand_rw.*
# Uninstall fio
sudo apt-get -y remove fio