Files
runc/network/loopback.go
T
Tim Hockin d25aa3cee7 Don't set the MTU for loopback interfaces.
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)
2014-07-15 01:01:26 +00:00

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
}