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

Reduce upload buffer size in GoogleTaskLogs. #16236

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

gianm
Copy link
Contributor

@gianm gianm commented Apr 4, 2024

Use a 1MB upload buffer, rather than the default of 15 MB in the API client. This is mainly because MMs may upload logs in parallel, and typically have small heaps. The default-sized 15 MB buffers add up quickly and can cause a MM to run out of memory.

Use a 1MB upload buffer, rather than the default of 15 MB in the API client. This is
mainly because MMs may upload logs in parallel, and typically have small heaps. The
default-sized 15 MB buffers add up quickly and can cause a MM to run out of memory.
{
storage.get().createFrom(getBlobInfo(bucket, path), mediaContent.getInputStream());
if (bufferSize == DEFAULT_BUFFER_SIZE) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We use the term chunkSize in the getObjectOutputStream API down below, and the default value as DEFAULT_WRITE_CHUNK_SIZE. Uniformity by modifying either one would be good.

Another uniformity among both can be in the way the default gets picked: currently one does a null check while another expects the default value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"Buffer size" is the term the Google API client uses for this parameter. It looks like it uses "chunk size" for the other parameter you mention. IMO, we should retain the terms the Google client uses, even though they aren't consistent with each other. Better to be consistent with the upstream terms.

As to the way the default gets picked, I'll change the bufferSize to be a @Nullable Integer to match the way chunkSize works.

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks!

@abhishekrb19 abhishekrb19 merged commit 5e5cf9a into apache:master Apr 8, 2024
85 checks passed
@gianm gianm deleted the gs-buffer-size branch April 9, 2024 16:42
@adarshsanjeev adarshsanjeev added this to the 30.0.0 milestone May 6, 2024
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.

4 participants