mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
ci(benchmark): Benchmark vm before n8n benchmark (#10859)
This commit is contained in:
parent
c43aef1a26
commit
aa283b7554
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
13
packages/@n8n/benchmark/scripts/vm-benchmark.sh
Normal file
13
packages/@n8n/benchmark/scripts/vm-benchmark.sh
Normal 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
|
Loading…
Reference in a new issue