Skip to content

Commit 3d0f83e

Browse files
lower get content chunk size (make it page aligned) (#58)
Co-authored-by: Luke Lombardi <[email protected]>
1 parent 91d1e35 commit 3d0f83e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929

3030
const (
3131
writeBufferSizeBytes int = 128 * 1024
32-
getContentStreamChunkSize int64 = 16 * 1024 * 1024 // 16MB
32+
getContentStreamChunkSize int64 = 4 * 1024 * 1024 // 4MB
3333
)
3434

3535
type CacheServiceOpts struct {
@@ -232,6 +232,7 @@ func (cs *CacheService) GetContentStream(req *proto.GetContentRequest, stream pr
232232
const chunkSize = getContentStreamChunkSize
233233
offset := req.Offset
234234
remainingLength := req.Length
235+
235236
Logger.Infof("GetContentStream[ACK] - [%s] - offset=%d, length=%d, %d bytes", req.Hash, offset, req.Length, remainingLength)
236237

237238
dst := make([]byte, chunkSize)
@@ -246,7 +247,6 @@ func (cs *CacheService) GetContentStream(req *proto.GetContentRequest, stream pr
246247
Logger.Debugf("GetContentStream - [%s] - %v", req.Hash, err)
247248
return status.Errorf(codes.NotFound, "Content not found: %v", err)
248249
}
249-
250250
if n == 0 {
251251
break
252252
}

0 commit comments

Comments
 (0)