mirror of
https://github.com/minio/minio.git
synced 2025-11-27 20:58:55 -05:00
replace io.Discard usage to fix some NUMA copy() latencies (#18394)
replace io.Discard usage to fix NUMA copy() latencies On NUMA systems copying from 8K buffer allocated via io.Discard leads to large latency build-up for every ``` copy(new8kbuf, largebuf) ``` can in-cur upto 1ms worth of latencies on NUMA systems due to memory sharding across NUMA nodes.
This commit is contained in:
@@ -19,6 +19,8 @@ package http
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
xioutil "github.com/minio/minio/internal/ioutil"
|
||||
)
|
||||
|
||||
// DrainBody close non nil response with any response Body.
|
||||
@@ -37,6 +39,6 @@ func DrainBody(respBody io.ReadCloser) {
|
||||
// the same connection for future uses.
|
||||
// - http://stackoverflow.com/a/17961593/4465767
|
||||
defer respBody.Close()
|
||||
io.Copy(io.Discard, respBody)
|
||||
xioutil.DiscardReader(respBody)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user