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

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

Closed

Conversation

thisalihassan
Copy link
Contributor

@thisalihassan thisalihassan commented Apr 10, 2024

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-bot nodejs-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
Copy link
Member

rluvaton commented Apr 10, 2024

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

@thisalihassan
Copy link
Contributor Author

thisalihassan commented Apr 10, 2024

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
Member

That was the old behavior, no?

@thisalihassan
Copy link
Contributor Author

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
Member

targos commented Apr 10, 2024

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)

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@rluvaton rluvaton left a comment

Choose a reason for hiding this comment

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

LGTM

@rluvaton rluvaton added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 11, 2024
@rluvaton rluvaton added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 11, 2024
@mcollina mcollina 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-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot nodejs-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
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
Contributor Author

@rluvaton windows tests are failing for some reason

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@rluvaton rluvaton 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-bot nodejs-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
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: #52456
Fixes: #52233
Refs: nodejs/performance#161
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
@rluvaton rluvaton 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: #52456
Fixes: #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: #52456
Fixes: #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 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: #52456
Fixes: #52233
Refs: nodejs/performance#161
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. benchmark Issues and PRs related to the benchmark subsystem. commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. performance Issues 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