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

Restore executor configuration for zio-grpc #443

Merged
merged 3 commits into from
Apr 15, 2024

Conversation

ghostdogpr
Copy link
Contributor

Summary of changes
Changes introduced in this pull request:

* availableProcessors(). Only the workStealing and fixed executors will use
* this value.
*/
val threads = System.getenv("JVM_EXECUTOR_THREADS")
Copy link
Owner

Choose a reason for hiding this comment

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

In general, should this be rather GRPC_SERVER_CPUS? This is the variable we pass to servers so that they know how many will be available upfront. Or, will the JVM_EXECUTOR_THREADS correctly do that under the hood? Unless there is some JVM magic happening, the service will assume max CPUs on the host (e.g., 32), use a proper GC for that but then it'll get clamped at, e.g., 1. This may also be the case for other JVM-based implementations here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I don't think there's any magic, so it will use Runtime.getRuntime.availableProcessors. I just copied the way it was done in the fs2 one, it seems to be used that way in 4 different tests: https://github.com/search?q=repo%3ALesnyRumcajs%2Fgrpc_bench%20JVM_EXECUTOR_THREADS&type=code
Shall I change them all to use GRPC_SERVER_CPUS instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just changed it.

Copy link
Owner

@LesnyRumcajs LesnyRumcajs left a comment

Choose a reason for hiding this comment

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

Fantastic, thank you!

@LesnyRumcajs LesnyRumcajs merged commit 7fa7e0a into LesnyRumcajs:master Apr 15, 2024
45 checks passed
@ghostdogpr ghostdogpr deleted the zio-grpc branch April 15, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants