Skip to content

Commit 07609e1

Browse files
authored
benchmark: restore old buffer size values for published benchmarks (#6516)
1 parent 2059c6e commit 07609e1

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

benchmark/client/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,12 @@ func main() {
136136
func buildConnections(ctx context.Context) []*grpc.ClientConn {
137137
ccs := make([]*grpc.ClientConn, *numConn)
138138
for i := range ccs {
139-
ccs[i] = benchmark.NewClientConnWithContext(ctx, "localhost:"+*port, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
139+
ccs[i] = benchmark.NewClientConnWithContext(ctx, "localhost:"+*port,
140+
grpc.WithTransportCredentials(insecure.NewCredentials()),
141+
grpc.WithBlock(),
142+
grpc.WithWriteBufferSize(128*1024),
143+
grpc.WithReadBufferSize(128*1024),
144+
)
140145
}
141146
return ccs
142147
}

benchmark/server/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import (
3939
"runtime/pprof"
4040
"time"
4141

42+
"google.golang.org/grpc"
4243
"google.golang.org/grpc/benchmark"
4344
"google.golang.org/grpc/grpclog"
4445
"google.golang.org/grpc/internal/syscall"
@@ -70,7 +71,10 @@ func main() {
7071
pprof.StartCPUProfile(cf)
7172
cpuBeg := syscall.GetCPUTime()
7273
// Launch server in a separate goroutine.
73-
stop := benchmark.StartServer(benchmark.ServerInfo{Type: "protobuf", Listener: lis})
74+
stop := benchmark.StartServer(benchmark.ServerInfo{Type: "protobuf", Listener: lis},
75+
grpc.WriteBufferSize(128*1024),
76+
grpc.ReadBufferSize(128*1024),
77+
)
7478
// Wait on OS terminate signal.
7579
ch := make(chan os.Signal, 1)
7680
signal.Notify(ch, os.Interrupt)

0 commit comments

Comments
 (0)