Skip to content

Commit

Permalink
increase default socket read/write buffer size (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana authored Apr 3, 2024
1 parent f08604e commit ff64916
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 80 deletions.
33 changes: 33 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -8359,6 +8359,39 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

================================================================

golang.org/x/time
https://golang.org/x/time
----------------------------------------------------------------
Copyright (c) 2009 The Go Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

================================================================

google.golang.org/protobuf
https://google.golang.org/protobuf
----------------------------------------------------------------
Expand Down
19 changes: 11 additions & 8 deletions cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ func clientTransport(ctx *cli.Context) http.RoundTripper {
KeepAlive: 10 * time.Second,
}).DialContext,
MaxIdleConnsPerHost: ctx.Int("concurrent"),
WriteBufferSize: ctx.Int("sndbuf"), // Configure beyond 4KiB default buffer size.
ReadBufferSize: ctx.Int("sndbuf"), // Configure beyond 4KiB default buffer size.
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 15 * time.Second,
ExpectContinueTimeout: 10 * time.Second,
Expand All @@ -201,17 +203,14 @@ func clientTransport(ctx *cli.Context) http.RoundTripper {
}
if ctx.Bool("tls") {
// Keep TLS config.
tlsConfig := &tls.Config{
tr.TLSClientConfig = &tls.Config{
RootCAs: mustGetSystemCertPool(),
// Can't use SSLv3 because of POODLE and BEAST
// Can't use TLSv1.0 because of POODLE and BEAST using CBC cipher
// Can't use TLSv1.1 because of RC4 cipher usage
MinVersion: tls.VersionTLS12,
MinVersion: tls.VersionTLS12,
InsecureSkipVerify: ctx.Bool("insecure"),
}
if ctx.Bool("insecure") {
tlsConfig.InsecureSkipVerify = true
}
tr.TLSClientConfig = tlsConfig

// Because we create a custom TLSClientConfig, we have to opt-in to HTTP/2.
// See https://github.com/golang/go/issues/14275
Expand Down Expand Up @@ -312,9 +311,13 @@ func newAdminClient(ctx *cli.Context) *madmin.AdminClient {
if len(hosts) == 0 {
fatalIf(probe.NewError(errors.New("no host defined")), "Unable to create MinIO admin client")
}
cl, err := madmin.New(hosts[0], ctx.String("access-key"), ctx.String("secret-key"), ctx.Bool("tls"))

cl, err := madmin.NewWithOptions(hosts[0], &madmin.Options{
Creds: credentials.NewStaticV4(ctx.String("access-key"), ctx.String("secret-key"), ""),
Secure: ctx.Bool("tls"),
Transport: clientTransport(ctx),
})
fatalIf(probe.NewError(err), "Unable to create MinIO admin client")
cl.SetCustomTransport(clientTransport(ctx))
cl.SetAppInfo(appName, pkg.Version)
return cl
}
5 changes: 5 additions & 0 deletions cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ var ioFlags = []cli.Flag{
Value: 20,
Usage: "Run this many concurrent operations per warp client",
},
cli.IntFlag{
Name: "sndbuf",
Value: 32 * 1024, // 32KiB up from 4KiB default
Usage: "specify custom read/write socket buffer size in bytes",
},
cli.BoolFlag{
Name: "noprefix",
Usage: "Do not use separate prefix for each thread",
Expand Down
44 changes: 21 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,76 +1,74 @@
module github.com/minio/warp

go 1.19
go 1.21

require (
github.com/bygui86/multi-profile/v2 v2.1.0
github.com/cheggaaa/pb v1.0.29
github.com/dustin/go-humanize v1.0.1
github.com/fatih/color v1.16.0
github.com/influxdata/influxdb-client-go/v2 v2.13.0
github.com/klauspost/compress v1.17.4
github.com/klauspost/compress v1.17.7
github.com/minio/cli v1.24.2
github.com/minio/madmin-go/v3 v3.0.37-0.20231211192618-d20cff0b11d9
github.com/minio/mc v0.0.0-20231215213629-9ad4ee9d08f0
github.com/minio/madmin-go/v3 v3.0.50
github.com/minio/mc v0.0.0-20240402091413-0e3d1d50bfcf
github.com/minio/md5-simd v1.1.2
github.com/minio/minio-go/v7 v7.0.66
github.com/minio/pkg/v2 v2.0.6
github.com/minio/minio-go/v7 v7.0.69
github.com/minio/pkg/v2 v2.0.14
github.com/minio/websocket v1.6.0
github.com/posener/complete v1.2.3
github.com/secure-io/sio-go v0.3.1
golang.org/x/net v0.21.0
golang.org/x/net v0.22.0
golang.org/x/time v0.5.0
)

require (
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/jwx v1.2.29 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed // indirect
github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/oapi-codegen/runtime v1.1.0 // indirect
github.com/oapi-codegen/runtime v1.1.1 // indirect
github.com/philhofer/fwd v1.1.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.51.1 // indirect
github.com/prometheus/procfs v0.13.0 // indirect
github.com/prometheus/prom2json v1.3.3 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rjeczalik/notify v0.9.3 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/safchain/ethtool v0.3.0 // indirect
github.com/shirou/gopsutil/v3 v3.23.11 // indirect
github.com/shirou/gopsutil/v3 v3.24.3 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/tinylib/msgp v1.1.9 // indirect
github.com/tklauser/go-sysconf v0.3.13 // indirect
github.com/tklauser/numcpus v0.7.0 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
Expand Down
Loading

0 comments on commit ff64916

Please sign in to comment.