mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 14:13:58 +08:00
d25aa3cee7
Setting the MTU for loopback has a huge performance impact on intra-container traffic. The loopback interface is not an ethernet interface and does not need the same limit. with this change I see a 4x speedup for loopback throughput. Docker-DCO-1.1-Signed-off-by: Tim Hockin <thockin@google.com> (github: thockin)
24 lines
499 B
Go
24 lines
499 B
Go
// +build linux
|
|
|
|
package network
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// Loopback is a network strategy that provides a basic loopback device
|
|
type Loopback struct {
|
|
}
|
|
|
|
func (l *Loopback) Create(n *Network, nspid int, networkState *NetworkState) error {
|
|
return nil
|
|
}
|
|
|
|
func (l *Loopback) Initialize(config *Network, networkState *NetworkState) error {
|
|
// Do not set the MTU on the loopback interface - use the default.
|
|
if err := InterfaceUp("lo"); err != nil {
|
|
return fmt.Errorf("lo up %s", err)
|
|
}
|
|
return nil
|
|
}
|