mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 21:07:28 -08:00
fix(benchmark): Benchmark improvements (#11290)
This commit is contained in:
parent
be50a9ac44
commit
0dd15cbe8d
|
@ -15,6 +15,12 @@ export default function () {
|
||||||
|
|
||||||
const res = http.post(`${apiBaseUrl}/webhook/binary-files-benchmark`, data);
|
const res = http.post(`${apiBaseUrl}/webhook/binary-files-benchmark`, data);
|
||||||
|
|
||||||
|
if (res.status !== 200) {
|
||||||
|
console.error(
|
||||||
|
`Invalid response. Received status ${res.status}. Body: ${JSON.stringify(res.body)}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
check(res, {
|
check(res, {
|
||||||
'is status 200': (r) => r.status === 200,
|
'is status 200': (r) => r.status === 200,
|
||||||
'has correct content type': (r) =>
|
'has correct content type': (r) =>
|
||||||
|
|
|
@ -6,6 +6,12 @@ const apiBaseUrl = __ENV.API_BASE_URL;
|
||||||
export default function () {
|
export default function () {
|
||||||
const res = http.post(`${apiBaseUrl}/webhook/benchmark-http-node`);
|
const res = http.post(`${apiBaseUrl}/webhook/benchmark-http-node`);
|
||||||
|
|
||||||
|
if (res.status !== 200) {
|
||||||
|
console.error(
|
||||||
|
`Invalid response. Received status ${res.status}. Body: ${JSON.stringify(res.body)}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
check(res, {
|
check(res, {
|
||||||
'is status 200': (r) => r.status === 200,
|
'is status 200': (r) => r.status === 200,
|
||||||
'http requests were OK': (r) => {
|
'http requests were OK': (r) => {
|
||||||
|
|
|
@ -5,6 +5,13 @@ const apiBaseUrl = __ENV.API_BASE_URL;
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
const res = http.post(`${apiBaseUrl}/webhook/code-node-benchmark`, {});
|
const res = http.post(`${apiBaseUrl}/webhook/code-node-benchmark`, {});
|
||||||
|
|
||||||
|
if (res.status !== 200) {
|
||||||
|
console.error(
|
||||||
|
`Invalid response. Received status ${res.status}. Body: ${JSON.stringify(res.body)}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
check(res, {
|
check(res, {
|
||||||
'is status 200': (r) => r.status === 200,
|
'is status 200': (r) => r.status === 200,
|
||||||
'has items in response': (r) => {
|
'has items in response': (r) => {
|
||||||
|
|
|
@ -5,6 +5,13 @@ const apiBaseUrl = __ENV.API_BASE_URL;
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
const res = http.post(`${apiBaseUrl}/webhook/set-expressions-benchmark`, {});
|
const res = http.post(`${apiBaseUrl}/webhook/set-expressions-benchmark`, {});
|
||||||
|
|
||||||
|
if (res.status !== 200) {
|
||||||
|
console.error(
|
||||||
|
`Invalid response. Received status ${res.status}. Body: ${JSON.stringify(res.body)}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
check(res, {
|
check(res, {
|
||||||
'is status 200': (r) => r.status === 200,
|
'is status 200': (r) => r.status === 200,
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,6 +5,13 @@ const apiBaseUrl = __ENV.API_BASE_URL;
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
const res = http.get(`${apiBaseUrl}/webhook/single-webhook`);
|
const res = http.get(`${apiBaseUrl}/webhook/single-webhook`);
|
||||||
|
|
||||||
|
if (res.status !== 200) {
|
||||||
|
console.error(
|
||||||
|
`Invalid response. Received status ${res.status}. Body: ${JSON.stringify(res.body)}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
check(res, {
|
check(res, {
|
||||||
'is status 200': (r) => r.status === 200,
|
'is status 200': (r) => r.status === 200,
|
||||||
});
|
});
|
|
@ -176,7 +176,7 @@ services:
|
||||||
|
|
||||||
# Load balancer that acts as an entry point for n8n
|
# Load balancer that acts as an entry point for n8n
|
||||||
n8n:
|
n8n:
|
||||||
image: nginx:latest
|
image: nginx:1.27.2
|
||||||
ports:
|
ports:
|
||||||
- '5678:80'
|
- '5678:80'
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
@ -3,6 +3,7 @@ events {}
|
||||||
http {
|
http {
|
||||||
client_max_body_size 50M;
|
client_max_body_size 50M;
|
||||||
access_log off;
|
access_log off;
|
||||||
|
error_log /dev/stderr warn;
|
||||||
|
|
||||||
upstream backend {
|
upstream backend {
|
||||||
server n8n_main1:5678;
|
server n8n_main1:5678;
|
||||||
|
|
|
@ -78,12 +78,6 @@ 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);
|
||||||
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Install fio
|
|
||||||
DEBIAN_FRONTEND=noninteractive 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
|
|
||||||
DEBIAN_FRONTEND=noninteractive sudo apt-get -y remove fio > /dev/null
|
|
Loading…
Reference in a new issue