Bug 981022 - [PERF] selinux module should require openshift-origin-common/config instead of openshift-origin-common
[PERF] selinux module should require openshift-origin-common/config instead o...
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Rob Millner
libra bugs
Depends On:
  Show dependency treegraph
Reported: 2013-07-03 15:37 EDT by Andy Grimm
Modified: 2016-11-07 22:47 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-07-22 11:20:47 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Andy Grimm 2013-07-03 15:37:26 EDT
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@ex-std-node1.prod ~]$ time oo-ruby -e 'require "openshift-origin-common"'

real	0m0.773s
user	0m0.344s
sys	0m0.340s
[agrimm@ex-std-node1.prod ~]$ time oo-ruby -e 'require "openshift-origin-common/config"'

real	0m0.239s
user	0m0.111s
sys	0m0.081s

and on a busier one:

[agrimm@ex-std-node46.prod lib]$ time oo-ruby -e 'require "openshift-origin-common"'

real	0m3.745s
user	0m0.411s
sys	0m0.511s
[agrimm@ex-std-node46.prod lib]$ time oo-ruby -e 'require "openshift-origin-common/config"'

real	0m0.546s
user	0m0.133s
sys	0m0.148s
Comment 1 openshift-github-bot 2013-07-09 12:56:42 EDT
Commit pushed to master at https://github.com/openshift/origin-server

Bug 981022 - only load the parts of common that are needed.
Comment 2 Meng Bo 2013-07-10 01:15:47 EDT
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'

Note You need to log in before you can comment on or make changes to this bug.