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

allow configuring number of vnode in the cluster on startup #15900

Open
BugenZhao opened this issue Mar 25, 2024 · 6 comments · Fixed by #15941
Open

allow configuring number of vnode in the cluster on startup #15900

BugenZhao opened this issue Mar 25, 2024 · 6 comments · Fixed by #15941
Assignees
Labels
component/storage Storage type/enhancement Improvements to existing implementation.
Milestone

Comments

@BugenZhao
Copy link
Member

In #3579, we discussed whether to adopt a vnode number other than 256 to achieve a better balance between scanning performance and maximal parallelism in a cluster. For quite some time afterwards, we find 256 works pretty well so the task was postponed.

Recently, we have observed some users running a RisingWave cluster with thousands of cores. While this is exciting, the performance of a single streaming job is unsurprisingly limited by the hardcoded vnode count of 256. I think instead of diving into the possibility of runtime dynamic or per-job vnode count, a low-hanging fruit could be allowing users configuring the vnode count on cluster startup as an immutable system parameter.

Thanks to #6513 and #8385, this seems to be made easy. However, it's still worth noting that the vnode count is limited by the algorithm of row-id generator since #9135.

@BugenZhao BugenZhao added type/enhancement Improvements to existing implementation. component/storage Storage labels Mar 25, 2024
@github-actions github-actions bot added this to the release-1.8 milestone Mar 25, 2024
@lmatz
Copy link
Contributor

lmatz commented Mar 25, 2024

What's the current behavior of creating a materialized view with default parallelism in a cluster that has more than 256 CPUs? e.g. is it that more than 256 actors will be created but only 256 of them is actually working

@BugenZhao
Copy link
Member Author

The parallelism was intended to be limited by the vnode count of 256, but there appear to be some edge cases. I will address that. 😄

if available_parallel_units.get() > VirtualNode::COUNT {
tracing::warn!(
"Too many parallel units, use {} instead",
VirtualNode::COUNT
);
NonZeroUsize::new(VirtualNode::COUNT).unwrap()
} else {
available_parallel_units
}

@BugenZhao
Copy link
Member Author

Not resolved but only workarounded by #15941. Thus reopen.

@fuyufjh
Copy link
Member

fuyufjh commented Aug 12, 2024

Time to work on this!

@fuyufjh
Copy link
Member

fuyufjh commented Aug 12, 2024

It's worth mentioning that the vnode has already been written into the state table (as a prefix of the key), thus, I think the vnode number of existing jobs can't be changed anymore. We need to ensure that

  1. The existing jobs can run properly with their correct vnode
  2. The new jobs will be scheduled according to the new changed global vnode number

@BugenZhao
Copy link
Member Author

BugenZhao commented Aug 21, 2024

2. The new jobs will be scheduled according to the new changed global vnode number

To achieve this, it appears that we are essentially providing support for different vnode count for different jobs. Then doing joins on these MVs can be tricky: we need to reimagine the Distribution in the optimizer to also reflect the number of vnodes. Still doable but I'm not sure whether it's worthwhile, considering 256 is sufficient for most of the customers and configurable vnode count is already a specialized request, not to mention local vnode counts.

A simpler approach is to always treat old clusters with unmodifiable 256 vnodes. Then only fresh clusters can benefit from this change. Note that the value still remains immutable after the cluster initializes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/storage Storage type/enhancement Improvements to existing implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants