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

[#642]feat(server): better default options for shuffle server #662

Merged
merged 4 commits into from
Feb 27, 2023

Conversation

advancedxy
Copy link
Contributor

@advancedxy advancedxy commented Feb 26, 2023

What changes were proposed in this pull request?

  1. rss.server.buffer.capacity uses JVM heap size * ratio(0.6) by default
  2. rss.server.read.buffer.capacity uses JVM heap size * ratio(0.2) by default
  3. rss.server.disk.capacity uses disk space * ratio(0.9) by default

Why are the changes needed?

Fix: #642

Does this PR introduce any user-facing change?

Yes. Three new configurations are introduced, users can specify ratio values
for buffer, read buffer and disk capacity

How was this patch tested?

New UTs.

@codecov-commenter
Copy link

codecov-commenter commented Feb 26, 2023

Codecov Report

Merging #662 (589cd7e) into master (c70d154) will increase coverage by 2.36%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master     #662      +/-   ##
============================================
+ Coverage     60.67%   63.04%   +2.36%     
- Complexity     1802     1807       +5     
============================================
  Files           216      202      -14     
  Lines         12458    10523    -1935     
  Branches       1052     1054       +2     
============================================
- Hits           7559     6634     -925     
+ Misses         4494     3543     -951     
+ Partials        405      346      -59     
Impacted Files Coverage Δ
...a/org/apache/uniffle/server/ShuffleServerConf.java 99.37% <100.00%> (+0.03%) ⬆️
...he/uniffle/server/buffer/ShuffleBufferManager.java 83.50% <100.00%> (+0.75%) ⬆️
...he/uniffle/server/storage/LocalStorageManager.java 87.70% <100.00%> (+1.26%) ⬆️
...rg/apache/uniffle/storage/common/LocalStorage.java 55.41% <100.00%> (+4.09%) ⬆️
.../java/org/apache/uniffle/server/ShuffleServer.java 62.06% <0.00%> (-1.98%) ⬇️
...pache/hadoop/mapreduce/task/reduce/RssFetcher.java 90.76% <0.00%> (-1.54%) ⬇️
deploy/kubernetes/operator/pkg/utils/rss.go
...rnetes/operator/pkg/webhook/inspector/inspector.go
deploy/kubernetes/operator/pkg/utils/config.go
...pkg/controller/sync/shuffleserver/shuffleserver.go
... and 13 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jerqi
Copy link
Contributor

jerqi commented Feb 27, 2023

Our memory is equal to rss.server.buffer.capacity + rss.server.read.buffer.capacity + extra memory used for program.

@advancedxy
Copy link
Contributor Author

Our memory is equal to rss.server.buffer.capacity + rss.server.read.buffer.capacity + extra memory used for program.

If I understand the shuffle server code correctly, read buffer and buffer capacity have some overlapping region, So it's possible rss.server.buffer.capacity + rss.server.read.buffer.capacity > 1.0.

The current default value may a bit larger consider the meta memory required for shuffle server.

@jerqi
Copy link
Contributor

jerqi commented Feb 27, 2023

Our memory is equal to rss.server.buffer.capacity + rss.server.read.buffer.capacity + extra memory used for program.

If I understand the shuffle server code correctly, read buffer and buffer capacity have some overlapping region, So it's possible rss.server.buffer.capacity + rss.server.read.buffer.capacity > 1.0.

The current default value may a bit larger consider the meta memory required for shuffle server.

They shouldn't have overlap.

@advancedxy
Copy link
Contributor Author

Our memory is equal to rss.server.buffer.capacity + rss.server.read.buffer.capacity + extra memory used for program.

If I understand the shuffle server code correctly, read buffer and buffer capacity have some overlapping region, So it's possible rss.server.buffer.capacity + rss.server.read.buffer.capacity > 1.0.
The current default value may a bit larger consider the meta memory required for shuffle server.

They shouldn't have overlap.

IIUC, the buffer caches data in memory, when reading with memory shuffle, the data size is calculated both for buffer and read buffer, these two regions should be considered overlapped region?

@zuston
Copy link
Member

zuston commented Feb 27, 2023

Our memory is equal to rss.server.buffer.capacity + rss.server.read.buffer.capacity + extra memory used for program.

From the point of view of production environment, the reserved system memory should be the half of xmx. If not, the full gc will occur when the server meets the high pressure.

@advancedxy
Copy link
Contributor Author

Our memory is equal to rss.server.buffer.capacity + rss.server.read.buffer.capacity + extra memory used for program.

From the point of view of production environment, the reserved system memory should be the half of xmx. If not, the full gc will occur when the server meets the high pressure.

Ouch, that hurts....

@jerqi
Copy link
Contributor

jerqi commented Feb 27, 2023

Our memory is equal to rss.server.buffer.capacity + rss.server.read.buffer.capacity + extra memory used for program.

If I understand the shuffle server code correctly, read buffer and buffer capacity have some overlapping region, So it's possible rss.server.buffer.capacity + rss.server.read.buffer.capacity > 1.0.
The current default value may a bit larger consider the meta memory required for shuffle server.

They shouldn't have overlap.

IIUC, the buffer caches data in memory, when reading with memory shuffle, the data size is calculated both for buffer and read buffer, these two regions should be considered overlapped region?

No, they will copy memory. They shouldn't overlap.

@advancedxy
Copy link
Contributor Author

No, they will copy memory. They shouldn't overlap.

Oh, I saw the code... This seems inefficient, let's reconsider this when doing off-heap memory management.

@advancedxy
Copy link
Contributor Author

Our memory is equal to rss.server.buffer.capacity + rss.server.read.buffer.capacity + extra memory used for program.

From the point of view of production environment, the reserved system memory should be the half of xmx. If not, the full gc will occur when the server meets the high pressure.

@zuston do you have any suggestion ratio for buffer and read buffer then.

@zuston
Copy link
Member

zuston commented Feb 27, 2023

@zuston do you have any suggestion ratio for buffer and read buffer then.

For us, read buffer size is the half of buffer capacity size. But from the dashboard, the read buffer size could be set to smaller.

@advancedxy
Copy link
Contributor Author

@zuston do you have any suggestion ratio for buffer and read buffer then.

For us, read buffer size is the half of buffer capacity size. But from the dashboard, the read buffer size could be set to smaller.

@zuston do you have any suggestion ratio for buffer and read buffer then.

For us, read buffer size is the half of buffer capacity size. But from the dashboard, the read buffer size could be set to smaller.

I just changed the default value of buffer capacity and read capacity ratio to 0.6 and 0.2, WDYT? @zuston @jerqi

Copy link
Contributor

@jerqi jerqi left a comment

Choose a reason for hiding this comment

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

LGTM

@advancedxy
Copy link
Contributor Author

Thanks, @zuston and @jerqi. I'm merging this.

@advancedxy advancedxy merged commit 9a1bc07 into apache:master Feb 27, 2023
advancedxy added a commit to advancedxy/incubator-uniffle that referenced this pull request Mar 21, 2023
…pache#662)

### What changes were proposed in this pull request?
1. `rss.server.buffer.capacity` uses JVM heap size * ratio(0.6) by default
2. `rss.server.read.buffer.capacity` uses JVM heap size * ratio(0.2) by default
3. `rss.server.disk.capacity` uses disk space * ratio(0.9) by default

### Why are the changes needed?
Fix: apache#642 

### Does this PR introduce _any_ user-facing change?
Yes. Three new configurations are introduced, users can specify ratio values
for buffer, read buffer and disk capacity

### How was this patch tested?
New UTs.
xianjingfeng pushed a commit to xianjingfeng/incubator-uniffle that referenced this pull request Apr 5, 2023
…pache#662)

### What changes were proposed in this pull request?
1. `rss.server.buffer.capacity` uses JVM heap size * ratio(0.6) by default
2. `rss.server.read.buffer.capacity` uses JVM heap size * ratio(0.2) by default
3. `rss.server.disk.capacity` uses disk space * ratio(0.9) by default

### Why are the changes needed?
Fix: apache#642 

### Does this PR introduce _any_ user-facing change?
Yes. Three new configurations are introduced, users can specify ratio values
for buffer, read buffer and disk capacity

### How was this patch tested?
New UTs.
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.

[Improvement] better default shuffle server configuration
4 participants