graphql-js icon indicating copy to clipboard operation
graphql-js copied to clipboard

benchmark: increase process priority

Open yaacovCR opened this issue 2 years ago • 21 comments

...to try to avoid involuntary context switches.

This seems to me to be pretty TETAW ("too easy to actually work").

yaacovCR avatar Jun 07 '22 17:06 yaacovCR

Deploy Preview for compassionate-pike-271cb3 ready!

Name Link
Latest commit e7fc7dd897ca519b7992dc873a2ff22a0ebf71d7
Latest deploy log https://app.netlify.com/sites/compassionate-pike-271cb3/deploys/62a0ab9f7137bb000819f989
Deploy Preview https://deploy-preview-3633--compassionate-pike-271cb3.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Jun 07 '22 17:06 netlify[bot]

Hi @yaacovCR, I'm @github-actions bot happy to help you with this PR 👋

Supported commands

Please post this commands in separate comments and only one per comment:

  • @github-actions run-benchmark - Run benchmark comparing base and merge commits for this PR
  • @github-actions publish-pr-on-npm - Build package from this PR and publish it on NPM

github-actions[bot] avatar Jun 07 '22 17:06 github-actions[bot]

@github-actions run-benchmark

yaacovCR avatar Jun 07 '22 17:06 yaacovCR

@github-actions run-benchmark

@yaacovCR Something went wrong, please check log.

github-actions[bot] avatar Jun 07 '22 17:06 github-actions[bot]

https://github.com/graphql/graphql-js/runs/6779810535?check_suite_focus=true#step:6:17

SystemError [ERR_SYSTEM_ERROR]: A system error occurred: uv_os_setpriority returned EACCES (permission denied) at new SystemError (node:internal/errors:239:5) at new NodeError (node:internal/errors:342:7) at Object.setPriority (node:os:305:11) at file:///home/runner/work/graphql-js/graphql-js/[eval1]:7:8 at ModuleJob.run (node:internal/modules/esm/module_job:198:25) at async ESMLoader.eval (node:internal/modules/esm/loader:252:24) at async loadESM (node:internal/process/esm_loader:85:5) at async handleMainPromise (node:internal/modules/run_main:61:12) { code: 'ERR_SYSTEM_ERROR', info: { errno: -13, code: 'EACCES', message: 'permission denied', syscall: 'uv_os_setpriority' }, errno: [Getter/Setter], syscall: [Getter/Setter] }

yaacovCR avatar Jun 07 '22 18:06 yaacovCR

Not sure if sudo can help us here. if i were github actions, it wouldn't!

yaacovCR avatar Jun 07 '22 18:06 yaacovCR

@yaacovCR I tried it locally and it didn't work. But we can try on CI, maybe it will work there. Also, CPU affinity can help, since the GH runner has 2 CPUs we can bound the benchmark to the second one.

IvanGoncharov avatar Jun 07 '22 19:06 IvanGoncharov

sudo and setPriority seem to be working! although another erupts when writing for some reason...

I can read more about affinity

yaacovCR avatar Jun 07 '22 19:06 yaacovCR

I am guessing when using a shell, piping via 3 does not work

https://github.com/graphql/graphql-js/blob/b91f51b8f9c6bc7a2d0b5d1ef7b6121bf094cac4/resources/benchmark.ts#L408

yaacovCR avatar Jun 07 '22 19:06 yaacovCR

@yaacovCR You need to pass sudo -C4 https://superuser.com/questions/394522/sudo-preserve-non-std-file-descriptors

IvanGoncharov avatar Jun 07 '22 19:06 IvanGoncharov

@yaacovCR Simpler solution would be to run the entire benchmark under sudo.

IvanGoncharov avatar Jun 07 '22 19:06 IvanGoncharov

@yaacovCR Simpler solution would be to run the entire benchmark under sudo.

That works for me.

As a side note, I want to make sure this works cross platform. I would assume that ci would add sudo to the whole command and local users would be required to do so on their own or use the windows equivalent.

yaacovCR avatar Jun 07 '22 19:06 yaacovCR

@github-actions run-benchmark

yaacovCR avatar Jun 08 '22 13:06 yaacovCR

@github-actions run-benchmark

@yaacovCR Something went wrong, please check log.

github-actions[bot] avatar Jun 08 '22 13:06 github-actions[bot]

@github-actions run-benchmark

yaacovCR avatar Jun 08 '22 13:06 yaacovCR

@github-actions run-benchmark

@yaacovCR Something went wrong, please check log.

github-actions[bot] avatar Jun 08 '22 13:06 github-actions[bot]

@github-actions run-benchmark

yaacovCR avatar Jun 08 '22 14:06 yaacovCR

@github-actions run-benchmark

@yaacovCR Something went wrong, please check log.

github-actions[bot] avatar Jun 08 '22 14:06 github-actions[bot]

@IvanGoncharov

sudo: you are not permitted to use the -C option

Needs further research

yaacovCR avatar Jun 08 '22 14:06 yaacovCR

Needs further research

@yaacovCR Can I quickly try to run some experiments on top of your PR?

IvanGoncharov avatar Jun 08 '22 17:06 IvanGoncharov

Needs further research

@yaacovCR Can I quickly try to run some experiments on top of your PR?

Definitely. Good luck!

yaacovCR avatar Jun 08 '22 17:06 yaacovCR