openshift-origin-node/utils/selinux currently requires openshift-origin-common, but it appears to only need that for loading a config object. Loading all of the requires in openshift-origin-common is expensive, and this translates to slower execution of scripts which should be fast, such as oo-trap-user and oo-get-mcs-level. For comparison on a fairly idle system: [agrimm ~]$ time oo-ruby -e 'require "openshift-origin-common"' real 0m0.773s user 0m0.344s sys 0m0.340s [agrimm ~]$ time oo-ruby -e 'require "openshift-origin-common/config"' real 0m0.239s user 0m0.111s sys 0m0.081s and on a busier one: [agrimm lib]$ time oo-ruby -e 'require "openshift-origin-common"' real 0m3.745s user 0m0.411s sys 0m0.511s [agrimm lib]$ time oo-ruby -e 'require "openshift-origin-common/config"' real 0m0.546s user 0m0.133s sys 0m0.148s
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/eae448337517199f018f8c38d7c0c159f88f8807 Bug 981022 - only load the parts of common that are needed.
Seems the bug is not easy to verify with normal test scenario. Checked on devenv_3471, the selinux.rb require opneshift-origin-common/cofing instead of openshift-origin-common now. #cat openshift-origin-node/utils/selinux.rb <----> require 'etc' require 'selinux' require 'find' require 'openshift-origin-common/config' require 'openshift-origin-node/utils/node_logger' <---->