Skip to content

Commit

Permalink
benchmark: restore old buffer size values for published benchmarks (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dfawley authored Aug 8, 2023
1 parent 2059c6e commit 07609e1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion benchmark/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ func main() {
func buildConnections(ctx context.Context) []*grpc.ClientConn {
ccs := make([]*grpc.ClientConn, *numConn)
for i := range ccs {
ccs[i] = benchmark.NewClientConnWithContext(ctx, "localhost:"+*port, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
ccs[i] = benchmark.NewClientConnWithContext(ctx, "localhost:"+*port,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithBlock(),
grpc.WithWriteBufferSize(128*1024),
grpc.WithReadBufferSize(128*1024),
)
}
return ccs
}
Expand Down
6 changes: 5 additions & 1 deletion benchmark/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
"runtime/pprof"
"time"

"google.golang.org/grpc"
"google.golang.org/grpc/benchmark"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/internal/syscall"
Expand Down Expand Up @@ -70,7 +71,10 @@ func main() {
pprof.StartCPUProfile(cf)
cpuBeg := syscall.GetCPUTime()
// Launch server in a separate goroutine.
stop := benchmark.StartServer(benchmark.ServerInfo{Type: "protobuf", Listener: lis})
stop := benchmark.StartServer(benchmark.ServerInfo{Type: "protobuf", Listener: lis},
grpc.WriteBufferSize(128*1024),
grpc.ReadBufferSize(128*1024),
)
// Wait on OS terminate signal.
ch := make(chan os.Signal, 1)
signal.Notify(ch, os.Interrupt)
Expand Down

0 comments on commit 07609e1

Please sign in to comment.