<p>I setup a kubernetes cluster with 2 powerful physical servers (32 cores + 64GB memory.) Everything runs very smooth except the bad network performance I observed.</p>

<p>As comparison: I run my service on such physical machine directly (one instance). Have a client machine in the same network subset calling the service. The rps can goes to 10k easily. While when I put the exact same service in kubernetes version 1.1.7, one pod (instance) of the service in launched and expose the service by ExternalIP in service yaml file. With the same client, the rps drops to 4k. Even after I switched to iptable mode of kube-proxy, it doesn't seem help a lot.</p>

<p>When I search around, I saw this document <a href="https://www.percona.com/blog/2016/02/05/measuring-docker-cpu-network-overhead/" rel="nofollow">https://www.percona.com/blog/2016/02/05/measuring-docker-cpu-network-overhead/</a></p>

<p>Seems the docker port-forwarding is the network bottleneck. While other network mode of docker: like --net=host, bridge network, or containers sharing network don't have such performance drop. Wondering whether Kubernetes team already aware of such network performance drop? Since docker containers are launched and managed by Kubernetes. Is there anyway to tune the kubernetest to use other network mode of docker?</p>

<p>You can configure Kubernetes networking in a number of different ways when configuring the cluster, and a few different ways on a per-pod basis. If you want to try verifying whether the docker networking arrangement is the problem, set <code>hostNetwork</code> to true in your pod specification and give it another try (<a href="https://github.com/kubernetes/kubernetes/blob/f7f60004eb92333849b75dbd8eeb75ba20afdf0e/examples/newrelic/newrelic-daemonset.yaml#L22" rel="nofollow">example here</a>). This is the equivalent of the docker --net=host setting.</p>
