Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-process Mode #215

Merged
merged 40 commits into from
Aug 21, 2023
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c43407b
Reorder
alexfernandez Aug 18, 2023
fa7b950
Separate derived results
alexfernandez Aug 18, 2023
e6a6bf5
Move compute percentiles from latency to result
alexfernandez Aug 18, 2023
134311d
Start test server in half the cores by default
alexfernandez Aug 18, 2023
2a01a16
Refactor a bit
alexfernandez Aug 18, 2023
e3ffaab
Move multicore code to its own file
alexfernandez Aug 18, 2023
2fec208
Run single-core if cores=1
alexfernandez Aug 18, 2023
b61a82c
Run loadtest in multicore with --cores
alexfernandez Aug 18, 2023
9d51eaa
Do not use deprecated api
alexfernandez Aug 18, 2023
bf97b22
Moved multicore to cluster
alexfernandez Aug 18, 2023
866b1ad
Make cluster work with scheduling policy none
alexfernandez Aug 20, 2023
4d1e5b8
Aggregate all results from all workers
alexfernandez Aug 20, 2023
db49e90
Function to combine results
alexfernandez Aug 20, 2023
467efd2
Reject result when there is an error in the cluster
alexfernandez Aug 20, 2023
c40d9af
New test to combine results
alexfernandez Aug 20, 2023
aa040f2
New test for results
alexfernandez Aug 20, 2023
b86ed9e
Combine results in map
alexfernandez Aug 20, 2023
390dba6
Add test for empty and complex results
alexfernandez Aug 20, 2023
320a152
Show how many cores the test run on
alexfernandez Aug 20, 2023
4e79d07
Combine histogram correctly
alexfernandez Aug 20, 2023
de626d8
Reset all values before combining
alexfernandez Aug 20, 2023
fb3aa96
Check elapsed seconds
alexfernandez Aug 20, 2023
6d9a1c6
Show results from workers
alexfernandez Aug 20, 2023
1ff3776
Share values amongst cores
alexfernandez Aug 20, 2023
e9bba93
Reorder
alexfernandez Aug 20, 2023
5a10e1e
Wait for server to start
alexfernandez Aug 20, 2023
ccedac8
Remove traces
alexfernandez Aug 20, 2023
f29b1e6
Divide max requests and rps by cores only if present
alexfernandez Aug 20, 2023
43b4c92
Share requests and rps properly among cores
alexfernandez Aug 20, 2023
e06415f
Share rps and max requests properly between cores
alexfernandez Aug 20, 2023
9846020
Show target and effective rps
alexfernandez Aug 20, 2023
1853c6d
Show effective rps last
alexfernandez Aug 20, 2023
ed23b94
Rename
alexfernandez Aug 20, 2023
3f07b29
Store start and end times in ns and ms
alexfernandez Aug 20, 2023
535a806
Compute elapsed seconds as derivative of start and end times
alexfernandez Aug 20, 2023
53149d6
Improve docs for result
alexfernandez Aug 21, 2023
22480ea
Show cores only if specified
alexfernandez Aug 21, 2023
b1d4974
Document --cores
alexfernandez Aug 21, 2023
772f0b3
v6.3.0
alexfernandez Aug 21, 2023
1de8e4e
Clarify --cores in the API
alexfernandez Aug 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Share requests and rps properly among cores
  • Loading branch information
alexfernandez committed Aug 20, 2023
commit 43b4c92062f83c097a7946fae8a828363e71b863
19 changes: 14 additions & 5 deletions bin/loadtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,27 @@ async function processAndRun(options) {
help();
}
options.url = options.args[0];
// share values amongst cores
const cores = parseInt(options.cores) || 1
options.maxRequests = options.maxRequests ? parseInt(options.maxRequests) / cores : null
options.rps = options.rps ? parseInt(options.rps) / cores : null
const results = await runTask(cores, async () => await startTest(options))
computeCores(options)
const results = await runTask(options.cores, async () => await startTest(options))
if (!results) {
process.exit(0)
return
}
showResults(results)
}

function computeCores(options) {
options.cores = parseInt(options.cores) || 1
if (options.maxRequests) {
const maxRequests = parseInt(options.maxRequests)
options.maxRequests = Math.round(maxRequests / options.cores)
}
if (options.rps) {
const rps = parseInt(options.rps)
options.rps = Math.round(rps / options.cores)
}
}

async function startTest(options) {
try {
return await loadTest(options)
Expand Down