Skip to content

lower get content chunk size (make it page aligned) #58

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

Merged
merged 1 commit into from
May 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

const (
writeBufferSizeBytes int = 128 * 1024
getContentStreamChunkSize int64 = 16 * 1024 * 1024 // 16MB
getContentStreamChunkSize int64 = 4 * 1024 * 1024 // 4MB
)

type CacheServiceOpts struct {
Expand Down Expand Up @@ -232,6 +232,7 @@ func (cs *CacheService) GetContentStream(req *proto.GetContentRequest, stream pr
const chunkSize = getContentStreamChunkSize
offset := req.Offset
remainingLength := req.Length

Logger.Infof("GetContentStream[ACK] - [%s] - offset=%d, length=%d, %d bytes", req.Hash, offset, req.Length, remainingLength)

dst := make([]byte, chunkSize)
Expand All @@ -246,7 +247,6 @@ func (cs *CacheService) GetContentStream(req *proto.GetContentRequest, stream pr
Logger.Debugf("GetContentStream - [%s] - %v", req.Hash, err)
return status.Errorf(codes.NotFound, "Content not found: %v", err)
}

if n == 0 {
break
}
Expand Down