Skip to content

benchmark: conditionally use spawn with taskset for CPU pinning - #52253

Merged
nodejs-github-bot merged 6 commits into
nodejs:mainfrom
thisalihassan:taskset_support_benchmark
Apr 6, 2024
Merged

benchmark: conditionally use spawn with taskset for CPU pinning#52253
nodejs-github-bot merged 6 commits into
nodejs:mainfrom
thisalihassan:taskset_support_benchmark

Conversation

@thisalihassan

@thisalihassanthisalihassan commented Mar 28, 2024

Copy link
Copy Markdown
Contributor

This PR updates our process spawning mechanism from fork to spawn to incorporate the taskset command, enabling CPU pinning for benchmark tasks. This change aims to improve benchmark consistency and reliability on systems with heterogeneous CPU cores.

closes#52233

@nodejs-github-botnodejs-github-bot added benchmark Issues and PRs related to the benchmark subsystem. performance Issues and PRs related to the performance of Node.js. labels Mar 28, 2024
Comment threadbenchmark/compare.js Outdated
Comment threadbenchmark/run.js Outdated
@thisalihassan
thisalihassanforce-pushed the taskset_support_benchmark branch from 072af25 to 3fb5b79CompareMarch 28, 2024 20:53
@thisalihassanthisalihassan changed the title taskset support for benchmarksbenchmark: conditionally use spawn with taskset for CPU pinningMar 28, 2024
Comment threadbenchmark/compare.js Outdated
Comment threadbenchmark/compare.js Outdated
Comment threadbenchmark/run.js Outdated
Comment threadbenchmark/run.js Outdated

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina

Copy link
Copy Markdown
Member

Can you please amend the first commit so it passes our linting rules? You can use npx core-validate-commit.

This change enhances the benchmarking tool by conditionally using the,
spawn method with taskset for CPU pinning, improving consistency of
benchmark results across different environments.
Fixes: nodejs#52233
@thisalihassan
thisalihassanforce-pushed the taskset_support_benchmark branch from 9ac9d79 to d6b0a82CompareMarch 31, 2024 21:25
@thisalihassan

Copy link
Copy Markdown
ContributorAuthor

Can you please amend the first commit so it passes our linting rules? You can use npx core-validate-commit.

image

thanks, it's passing all now except

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollinamcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 1, 2024
@mcollina

Copy link
Copy Markdown
Member

I've run the benchmarking script myself and verified that it does not switch CPU.

@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 1, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@thisalihassan

Copy link
Copy Markdown
ContributorAuthor

is it normal that CI takes more than 14hours?

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@mcollina

Copy link
Copy Markdown
Member

No, let's see if I was able to kick it back up.

@mertcanaltinmertcanaltin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@thisalihassan

Copy link
Copy Markdown
ContributorAuthor

Build from tarball / test-tarball-linux (pull_request) is stuck again, it's been running for 3d, can someone let me know if something needs to be fixed in the PR?

Comment threadbenchmark/_cli.js
@thisalihassan
thisalihassanforce-pushed the taskset_support_benchmark branch from b070fa2 to 5f700f5CompareApril 5, 2024 23:09
@rluvatonrluvaton added commit-queue Add this label to land a pull request using GitHub Actions. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Apr 6, 2024
@nodejs-github-botnodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Apr 6, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/52253
✔ Done loading data for nodejs/node/pull/52253
----------------------------------- PR info ------------------------------------
Title benchmark: conditionally use spawn with taskset for CPU pinning (#52253)
⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch thisalihassan:taskset_support_benchmark -> nodejs:main
Labels benchmark, performance, author ready
Commits 6
- benchmark: conditionally use spawn with taskset for cpu pinning
- benchmark: run lint
- benchmark: refactor code for benchmark cpu settings
- benchmark: prefer node import syntax for built-in child_process
- docs: update benchmarks md to explain CPUSET variable
- benchmark: fix stdio on stderr for child process
Committers 1
- Ali Hassan PR-URL: https://github.com/nodejs/node/pull/52253
Reviewed-By: Matteo Collina Reviewed-By: Raz Luvaton Reviewed-By: Yagiz Nizipli ------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/52253
Reviewed-By: Matteo Collina Reviewed-By: Raz Luvaton Reviewed-By: Yagiz Nizipli --------------------------------------------------------------------------------
ℹ This PR was created on Thu, 28 Mar 2024 15:21:09 GMT
✔ Approvals: 3
✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/52253#pullrequestreview-1970850302
✔ - Raz Luvaton (@rluvaton): https://github.com/nodejs/node/pull/52253#pullrequestreview-1984706306
✔ - Yagiz Nizipli (@anonrig) (TSC): https://github.com/nodejs/node/pull/52253#pullrequestreview-1981518776
✔ Last GitHub CI successful
ℹ Green GitHub CI is sufficient
--------------------------------------------------------------------------------
✔ No git cherry-pick in progress
✔ No git am in progress
✔ No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
* branch main -> FETCH_HEAD
✔ origin/main is now up-to-date
- Downloading patch for 52253
From https://github.com/nodejs/node
* branch refs/pull/52253/merge -> FETCH_HEAD
✔ Fetched commits as ba07e4e5e643..5f700f58ec81
--------------------------------------------------------------------------------
[main 3c831d10f9] benchmark: conditionally use spawn with taskset for cpu pinning
Author: Ali Hassan Date: Thu Mar 28 20:18:15 2024 +0500
2 files changed, 50 insertions(+), 9 deletions(-)
[main a1a9ea842b] benchmark: run lint
Author: Ali Hassan Date: Fri Mar 29 02:21:59 2024 +0500
2 files changed, 4 insertions(+), 4 deletions(-)
[main 511f2a7dc2] benchmark: refactor code for benchmark cpu settings
Author: Ali Hassan Date: Sat Mar 30 04:53:37 2024 +0500
3 files changed, 38 insertions(+), 15 deletions(-)
[main b9577be4c0] benchmark: prefer node import syntax for built-in child_process
Author: Ali Hassan Date: Sat Mar 30 15:10:36 2024 +0500
2 files changed, 2 insertions(+), 2 deletions(-)
[main 137610d821] docs: update benchmarks md to explain CPUSET variable
Author: Ali Hassan Date: Fri Apr 5 12:44:29 2024 +0500
1 file changed, 36 insertions(+)
[main d44dadece0] benchmark: fix stdio on stderr for child process
Author: Ali Hassan Date: Sat Apr 6 04:09:09 2024 +0500
2 files changed, 6 insertions(+), 8 deletions(-)
✔ Patches applied
There are 6 commits in the PR. Attempting autorebase.
Rebasing (2/12)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
benchmark: conditionally use spawn with taskset for cpu pinning

This change enhances the benchmarking tool by conditionally using the,
spawn method with taskset for CPU pinning, improving consistency of
benchmark results across different environments.

Fixes: #52233
PR-URL: #52253
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Yagiz Nizipli yagiz.nizipli@sentry.io

[detached HEAD 7362ac3807] benchmark: conditionally use spawn with taskset for cpu pinning
Author: Ali Hassan ali-hassan27@outlook.com
Date: Thu Mar 28 20:18:15 2024 +0500
2 files changed, 50 insertions(+), 9 deletions(-)
Rebasing (3/12)
Rebasing (4/12)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
benchmark: run lint

PR-URL: #52253
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Yagiz Nizipli yagiz.nizipli@sentry.io

[detached HEAD 1282101554] benchmark: run lint
Author: Ali Hassan ali-hassan27@outlook.com
Date: Fri Mar 29 02:21:59 2024 +0500
2 files changed, 4 insertions(+), 4 deletions(-)
Rebasing (5/12)
Rebasing (6/12)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
benchmark: refactor code for benchmark cpu settings

PR-URL: #52253
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Yagiz Nizipli yagiz.nizipli@sentry.io

[detached HEAD 23a8358636] benchmark: refactor code for benchmark cpu settings
Author: Ali Hassan ali-hassan27@outlook.com
Date: Sat Mar 30 04:53:37 2024 +0500
3 files changed, 38 insertions(+), 15 deletions(-)
Rebasing (7/12)
Rebasing (8/12)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
benchmark: prefer node import syntax for built-in child_process

PR-URL: #52253
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Yagiz Nizipli yagiz.nizipli@sentry.io

[detached HEAD 052a8c9d28] benchmark: prefer node import syntax for built-in child_process
Author: Ali Hassan ali-hassan27@outlook.com
Date: Sat Mar 30 15:10:36 2024 +0500
2 files changed, 2 insertions(+), 2 deletions(-)
Rebasing (9/12)
Rebasing (10/12)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
docs: update benchmarks md to explain CPUSET variable

PR-URL: #52253
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Yagiz Nizipli yagiz.nizipli@sentry.io

[detached HEAD a2eb5d2273] docs: update benchmarks md to explain CPUSET variable
Author: Ali Hassan ali-hassan27@outlook.com
Date: Fri Apr 5 12:44:29 2024 +0500
1 file changed, 36 insertions(+)
Rebasing (11/12)
Rebasing (12/12)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
benchmark: fix stdio on stderr for child process

PR-URL: #52253
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Yagiz Nizipli yagiz.nizipli@sentry.io

[detached HEAD 92e603f9cb] benchmark: fix stdio on stderr for child process
Author: Ali Hassan ali-hassan27@outlook.com
Date: Sat Apr 6 04:09:09 2024 +0500
2 files changed, 6 insertions(+), 8 deletions(-)

Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/8584238305

@rluvatonrluvaton added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Apr 6, 2024
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 6, 2024
@nodejs-github-bot
nodejs-github-bot merged commit 47c934e into nodejs:mainApr 6, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 47c934e

Comment threadbenchmark/compare.js
Comment threadbenchmark/compare.js
marco-ippolito pushed a commit that referenced this pull request May 2, 2024
This change enhances the benchmarking tool by conditionally using the,
spawn method with taskset for CPU pinning, improving consistency of
benchmark results across different environments.
Fixes: #52233
PR-URL: #52253
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
@marco-ippolitomarco-ippolito mentioned this pull request May 2, 2024
marco-ippolito pushed a commit that referenced this pull request May 3, 2024
This change enhances the benchmarking tool by conditionally using the,
spawn method with taskset for CPU pinning, improving consistency of
benchmark results across different environments.
Fixes: #52233
PR-URL: #52253
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.benchmarkIssues and PRs related to the benchmark subsystem.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.performanceIssues and PRs related to the performance of Node.js.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support starting benchmark tasks using taskset on Linux

6 participants

@thisalihassan@mcollina@nodejs-github-bot@anonrig@rluvaton@mertcanaltin