Skip to content

benchmark: add ipc support to benchmark spawn stdio config - #52456

Closed
thisalihassan wants to merge 2 commits into
nodejs:mainfrom
thisalihassan:benchmark-fix-spawn-ipc
Closed

benchmark: add ipc support to benchmark spawn stdio config#52456
thisalihassan wants to merge 2 commits into
nodejs:mainfrom
thisalihassan:benchmark-fix-spawn-ipc

Conversation

@thisalihassan

@thisalihassanthisalihassan commented Apr 10, 2024

Copy link
Copy Markdown
Contributor

Fix (ipc) in the stdio configuration of the spawn function within the benchmark subsystem.

This PRs fixes the mistake in PR (benchmark: conditionally use spawn with taskset for CPU pinning) where I removed IPC by mistake due to which child.on("message") listener wasn't working.

I also made sure of cpu usage of cores provided to taskset and checked if the csv is all good

Fixes: #52233
Refs: nodejs/performance#161

Enabled inter-process communication (ipc) in the stdio configuration
of the spawn function within the benchmark subsystem.
This change allows for improved data exchange between parent
and benchmarked child processes, addressing limitations in performance
testing scenarios.
Fixes: nodejs#52233
Refs: nodejs/performance#161
@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 Apr 10, 2024
@rluvaton

rluvaton commented Apr 10, 2024

Copy link
Copy Markdown
Member

Please remove the pipe to process stdout as this will mess up the compare/run output which should be csv

@thisalihassan

thisalihassan commented Apr 10, 2024

Copy link
Copy Markdown
ContributorAuthor

Please remove the pipe to process stdout as this will mess up the compare/run output which should be csv

okay note that it will not print console.logs/error of child scripts in the terminal then while with fork pipes are established automatically

@rluvaton

Copy link
Copy Markdown
Member

That was the old behavior, no?

@thisalihassan

Copy link
Copy Markdown
ContributorAuthor

That was the old behavior, no?

when not using CPUSET command benchmark will use fork to run the child scripts and fork prints out console.log/console.errors..info..warn of forked instance to the parent instance thus you can see the logs in the terminal.

I wanted to maintain that behavior of fork while using spawn, so that's why we ned to pipe stdio and stderr to the parent (Fork does this by default)

@targos

Copy link
Copy Markdown
Member

I wanted to maintain that behavior of fork while using spawn, so that's why we ned to pipe stdio and stderr to the parent (Fork does this by default)

I know it's unrelated to this PR, but wouldn't 'inherit' instead of 'pipe' in the second and third positions make it simpler (then you could remove the manual piping to the parent)

@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

@rluvatonrluvaton 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

@rluvatonrluvaton added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 11, 2024
@rluvatonrluvaton added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 11, 2024
@mcollinamcollina added commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. request-ci Add this label to start a Jenkins CI on a PR. labels Apr 12, 2024
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@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 12, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/52456
✔ Done loading data for nodejs/node/pull/52456
----------------------------------- PR info ------------------------------------
Title benchmark: add ipc support to benchmark spawn stdio config (#52456)
⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch thisalihassan:benchmark-fix-spawn-ipc -> nodejs:main
Labels benchmark, performance, author ready, commit-queue-rebase
Commits 2
- benchmark: add ipc support to spawn stdio config
- benchmark: inherit stdio/stderr instead of pipe
Committers 1
- Ali Hassan PR-URL: https://github.com/nodejs/node/pull/52456
Fixes: https://github.com/nodejs/node/issues/52233
Refs: https://github.com/nodejs/performance/pull/161
Reviewed-By: Matteo Collina Reviewed-By: Raz Luvaton ------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/52456
Fixes: https://github.com/nodejs/node/issues/52233
Refs: https://github.com/nodejs/performance/pull/161
Reviewed-By: Matteo Collina Reviewed-By: Raz Luvaton --------------------------------------------------------------------------------
ℹ This PR was created on Wed, 10 Apr 2024 19:46:18 GMT
✔ Approvals: 2
✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/52456#pullrequestreview-1993644517
✔ - Raz Luvaton (@rluvaton): https://github.com/nodejs/node/pull/52456#pullrequestreview-1994683235
✘ Last GitHub CI failed
ℹ Green GitHub CI is sufficient
--------------------------------------------------------------------------------
✔ Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/8667228479

@thisalihassan

Copy link
Copy Markdown
ContributorAuthor

@rluvaton windows tests are failing for some reason

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@rluvatonrluvaton added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Apr 13, 2024
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 13, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 3634f9c...82891ae

nodejs-github-bot pushed a commit that referenced this pull request Apr 13, 2024
Enabled inter-process communication (ipc) in the stdio configuration
of the spawn function within the benchmark subsystem.
This change allows for improved data exchange between parent
and benchmarked child processes, addressing limitations in performance
testing scenarios.
Fixes: #52233
Refs: nodejs/performance#161
PR-URL: #52456
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
nodejs-github-bot pushed a commit that referenced this pull request Apr 13, 2024
PR-URL: #52456Fixes: #52233
Refs: nodejs/performance#161
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
@rluvatonrluvaton mentioned this pull request Apr 13, 2024
aduh95 pushed a commit that referenced this pull request Apr 29, 2024
Enabled inter-process communication (ipc) in the stdio configuration
of the spawn function within the benchmark subsystem.
This change allows for improved data exchange between parent
and benchmarked child processes, addressing limitations in performance
testing scenarios.
Fixes: #52233
Refs: nodejs/performance#161
PR-URL: #52456
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
aduh95 pushed a commit that referenced this pull request Apr 29, 2024
PR-URL: #52456Fixes: #52233
Refs: nodejs/performance#161
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
marco-ippolito pushed a commit that referenced this pull request May 2, 2024
Enabled inter-process communication (ipc) in the stdio configuration
of the spawn function within the benchmark subsystem.
This change allows for improved data exchange between parent
and benchmarked child processes, addressing limitations in performance
testing scenarios.
Fixes: #52233
Refs: nodejs/performance#161
PR-URL: #52456
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
marco-ippolito pushed a commit that referenced this pull request May 2, 2024
PR-URL: #52456Fixes: #52233
Refs: nodejs/performance#161
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
@marco-ippolitomarco-ippolito mentioned this pull request May 2, 2024
marco-ippolito pushed a commit that referenced this pull request May 3, 2024
Enabled inter-process communication (ipc) in the stdio configuration
of the spawn function within the benchmark subsystem.
This change allows for improved data exchange between parent
and benchmarked child processes, addressing limitations in performance
testing scenarios.
Fixes: #52233
Refs: nodejs/performance#161
PR-URL: #52456
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
marco-ippolito pushed a commit that referenced this pull request May 3, 2024
PR-URL: #52456Fixes: #52233
Refs: nodejs/performance#161
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
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-rebaseAdd this label to allow the Commit Queue to land a PR in several commits.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

5 participants

@thisalihassan@rluvaton@targos@nodejs-github-bot@mcollina