Skip to content

WorkerCount() function ignores the golden ratio recommendations #460

@blacks1ne

Description

@blacks1ne

WorkerCount() defined in utils/runtime/runtime.go is called by node/main.go to determine the optimal worker count for the standalone node without explicit worker configuration. It should return a safe worker count for a given machine.
The current WorkerCount() implementation only considers the CPU thread (a.k.a. logical core) count while ignoring the memory and disk space requirements defined by the corresponding 1:2:4 golden ratio.
There are some memory checks and warnings implemented in node/main.go, but are marginally useful in the highlighter less experience node operator use case.
We could consider the memory requirement to be a must and include it in the WorkerCount() implementation. The disk space requirement could log a warning, if not met, and be left for the user to fix (which should be much simpler that adding more memory).
We may also consider moving all worker requirements (such as memory and disk) and warnings to a dedicated class (such as utils/runtime/runtime.go) instead of hard-coding them in node/main.go. That would make code cleaner and easier to read and edit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions