Skip to content

Commit

Permalink
increase default socket read/write buffer size (minio#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.