-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move iptables check out of runtime init() to separate function #10231
Conversation
@@ -25,6 +25,7 @@ const ( | |||
|
|||
var ( | |||
supportsXlock = false | |||
iptablesPath = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a big fan of this but I see what you are trying to do. It just might be confusing to someone just looking at the code with no background
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also it can be iptablesPath string
no = ""
which is a little bit better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point.. I was thinking initialization to force type, but specifying type makes it cleaner, thx
can you give the time, with the patch too :) would be interesting to see the difference |
@jfrazelle I will definitely try and get that.. I'm not the guy with the huge POWER8 box, but I can get him a binary, I think :) I left out all his perf. data that showed where |
oh ok no worries then :) On Tue, Jan 20, 2015 at 4:18 PM, Phil Estes notifications@github.com
|
Due to the iptables package being `init`ed at start of the docker runtime, this means the iptables --wait command listing all rules is run, no matter if the command is simply "docker -h". It makes more sense to both locate the iptables command and check for the wait flag support at the time iptables is actually used, as it may not be used at all if certain network support is off/configured differently. Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
de66f04
to
5e8285b
Compare
LGTM |
1 similar comment
LGTM |
Move iptables check out of runtime init() to separate function
Due to the iptables package being
init()
ed at start of the dockerruntime, this means the
iptables --wait ...
command listing all rulesis run, no matter if the command is simply "
docker -h
". It makesmore sense to both locate the
iptables
command lookup and check for thewait flag support at the time iptables is actually used, as it
may not be used at all if certain network support is off/configured
differently.
Additional details:
The reason this is of interest is that on a significantly large box (many hundreds of CPU threads) and thousands of rules (e.g. few thousand docker containers up),
docker -h
can take significantly longer than on a standard SMP x86 box with only a few docker containers:While a kernel issue revealed by this problem related to per-CPU counters will be fixed upstream, that may take some time to exist in distros that end users run.
Docker-DCO-1.1-Signed-off-by: Phil Estes estesp@linux.vnet.ibm.com (github: estesp)