mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
separate lock from common grid to avoid epoll contention (#20180)
epoll contention on TCP causes latency build-up when we have high volume ingress. This PR is an attempt to relieve this pressure. upstream issue https://github.com/golang/go/issues/65064 It seems to be a deeper problem; haven't yet tried the fix provide in this issue, but however this change without changing the compiler helps. Of course, this is a workaround for now, hoping for a more comprehensive fix from Go runtime.
This commit is contained in:
@@ -26,20 +26,28 @@ import (
|
||||
|
||||
// Composed function registering routers for only distributed Erasure setup.
|
||||
func registerDistErasureRouters(router *mux.Router, endpointServerPools EndpointServerPools) {
|
||||
var (
|
||||
lockGrid = globalLockGrid.Load()
|
||||
commonGrid = globalGrid.Load()
|
||||
)
|
||||
|
||||
// Register storage REST router only if its a distributed setup.
|
||||
registerStorageRESTHandlers(router, endpointServerPools, globalGrid.Load())
|
||||
registerStorageRESTHandlers(router, endpointServerPools, commonGrid)
|
||||
|
||||
// Register peer REST router only if its a distributed setup.
|
||||
registerPeerRESTHandlers(router, globalGrid.Load())
|
||||
registerPeerRESTHandlers(router, commonGrid)
|
||||
|
||||
// Register bootstrap REST router for distributed setups.
|
||||
registerBootstrapRESTHandlers(globalGrid.Load())
|
||||
registerBootstrapRESTHandlers(commonGrid)
|
||||
|
||||
// Register distributed namespace lock routers.
|
||||
registerLockRESTHandlers()
|
||||
registerLockRESTHandlers(lockGrid)
|
||||
|
||||
// Add lock grid to router
|
||||
router.Handle(grid.RouteLockPath, adminMiddleware(lockGrid.Handler(storageServerRequestValidate), noGZFlag, noObjLayerFlag))
|
||||
|
||||
// Add grid to router
|
||||
router.Handle(grid.RoutePath, adminMiddleware(globalGrid.Load().Handler(storageServerRequestValidate), noGZFlag, noObjLayerFlag))
|
||||
router.Handle(grid.RoutePath, adminMiddleware(commonGrid.Handler(storageServerRequestValidate), noGZFlag, noObjLayerFlag))
|
||||
}
|
||||
|
||||
// List of some generic middlewares which are applied for all incoming requests.
|
||||
|
||||
Reference in New Issue
Block a user