improve obd tests and optimize network (#9378)

- keep long running obd network tests alive
- fix error - wrong number of parents in process OBD info
- ensure that osinfo does not error out when inside containers
- remove limit on max number of connections per client transport

The generic client transport uses a default limit of 64 conns per transport.
This could end up limiting and throttling usage, and artificially slowing
down the performance of MinIO even on hardware capable of doing better.
This commit is contained in:
Sidhartha Mani 2020-04-18 11:06:11 -07:00 committed by GitHub
parent b54c0f0ef3
commit 3e78ea8acc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 15 deletions

View File

@ -317,16 +317,14 @@ func getLocalProcOBD(ctx context.Context) madmin.ServerProcOBDInfo {
sysProc.PageFaults = pageFaults sysProc.PageFaults = pageFaults
parent, err := proc.ParentWithContext(ctx) parent, err := proc.ParentWithContext(ctx)
if err != nil { if err == nil {
return errProcInfo(err) sysProc.Parent = parent.Pid
} }
sysProc.Parent = parent.Pid
ppid, err := proc.PpidWithContext(ctx) ppid, err := proc.PpidWithContext(ctx)
if err != nil { if err == nil {
return errProcInfo(err) sysProc.Ppid = ppid
} }
sysProc.Ppid = ppid
rlimit, err := proc.RlimitWithContext(ctx) rlimit, err := proc.RlimitWithContext(ctx)
if err != nil { if err != nil {
@ -404,13 +402,8 @@ func getLocalOsInfoOBD(ctx context.Context) madmin.ServerOsOBDInfo {
} }
} }
users, err := host.UsersWithContext(ctx) // ignore user err, as it cannot be obtained reliably inside containers
if err != nil { users, _ := host.UsersWithContext(ctx)
return madmin.ServerOsOBDInfo{
Addr: addr,
Error: err.Error(),
}
}
return madmin.ServerOsOBDInfo{ return madmin.ServerOsOBDInfo{
Addr: addr, Addr: addr,

View File

@ -374,7 +374,11 @@ func (client *peerRESTClient) DispatchNetOBDInfo(ctx context.Context) (info madm
return return
} }
defer http.DrainBody(respBody) defer http.DrainBody(respBody)
err = gob.NewDecoder(respBody).Decode(&info) waitReader, err := waitForHTTPResponse(respBody)
if err != nil {
return
}
err = gob.NewDecoder(waitReader).Decode(&info)
return return
} }

View File

@ -403,9 +403,12 @@ func (s *peerRESTServer) DispatchNetOBDInfoHandler(w http.ResponseWriter, r *htt
return return
} }
done := keepHTTPResponseAlive(w)
ctx := newContext(r, w, "DispatchNetOBDInfo") ctx := newContext(r, w, "DispatchNetOBDInfo")
info := globalNotificationSys.NetOBDInfo(ctx) info := globalNotificationSys.NetOBDInfo(ctx)
done()
logger.LogIf(ctx, gob.NewEncoder(w).Encode(info)) logger.LogIf(ctx, gob.NewEncoder(w).Encode(info))
w.(http.Flusher).Flush() w.(http.Flusher).Flush()
} }

View File

@ -471,7 +471,6 @@ func newCustomHTTPTransport(tlsConfig *tls.Config, dialTimeout time.Duration) fu
DialContext: newCustomDialContext(dialTimeout, 15*time.Second), DialContext: newCustomDialContext(dialTimeout, 15*time.Second),
MaxIdleConnsPerHost: 16, MaxIdleConnsPerHost: 16,
MaxIdleConns: 16, MaxIdleConns: 16,
MaxConnsPerHost: 64, // This is used per drive/rpc host. More requests will block until free.
IdleConnTimeout: 1 * time.Minute, IdleConnTimeout: 1 * time.Minute,
ResponseHeaderTimeout: 3 * time.Minute, // Set conservative timeouts for MinIO internode. ResponseHeaderTimeout: 3 * time.Minute, // Set conservative timeouts for MinIO internode.
TLSHandshakeTimeout: 10 * time.Second, TLSHandshakeTimeout: 10 * time.Second,