This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 971159 - find command in oo-auto-idler is very inefficient
find command in oo-auto-idler is very inefficient
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Mrunal Patel
libra bugs
:
Depends On:
Blocks: 1034436
  Show dependency treegraph
 
Reported: 2013-06-05 16:27 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:
: 1034436 (view as bug list)
Environment:
Last Closed: 2013-06-11 00:00:15 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andy Grimm 2013-06-05 16:27:57 EDT
The new oo-auto-idler script calls this in each gear:

find #{gear_dir} -name 'manifest.yml'

This searches the entirely subdirectory structure and can be very slow, when there should be only a small number of valid places to look for this.  Adding exclusions and/or maxdepth would help tremendously (and I wonder why you're shelling out to "find" here at all; surely ruby has efficient functions for walking directories?)
Comment 1 Mrunal Patel 2013-06-05 20:34:03 EDT
Ruby is really slow at these operations hence we use find/grep. 

https://github.com/openshift/origin-server/pull/2766
Comment 2 Meng Bo 2013-06-06 06:12:57 EDT
Checked on devenv_3324, oo-auto-idler is running faster than it was.


# time oo-auto-idler idle --list --interval 1
Gears idle for 1 hours
Only listing idle gears
/var/lib/openshift/26f632cace5611e2a06b22000a989659 is STALE
/var/lib/openshift/51affe8b86b7d20a64000003 is STALE
/var/lib/openshift/51b0005886b7d2074c00000a is STALE
/var/lib/openshift/432396231384476013297664 is STALE
/var/lib/openshift/f4c69152ce5811e2849422000a989659 is STALE
/var/lib/openshift/883642144850386440159232 is STALE
/var/lib/openshift/51b0057586b7d20a6400001b is STALE
/var/lib/openshift/282697404012273460051968 is STALE
/var/lib/openshift/817795850653247962349568 is STALE
/var/lib/openshift/217357998652319265193984 is STALE
/var/lib/openshift/611632593128025483116544 is STALE
/var/lib/openshift/6685911cce6d11e29f1c22000a989659 is STALE
/var/lib/openshift/51b024fd86b7d222db00000e is STALE
/var/lib/openshift/51b0266786b7d23948000001 is STALE
/var/lib/openshift/1a7edfa6ce7411e2bf7922000a989659 is STALE
/var/lib/openshift/673107962295688577941504 is STALE
/var/lib/openshift/128926103801895315308544 is STALE
/var/lib/openshift/51b034e886b7d23948000026 is STALE
/var/lib/openshift/455673363436195373121536 is STALE
/var/lib/openshift/46c2cba8ce7a11e2b5ea22000a989659 is STALE
/var/lib/openshift/51b03a1c86b7d246d1000010 is STALE
/var/lib/openshift/edf62fe6ce7f11e2bafc22000a989659 is STALE
/var/lib/openshift/51b0456f86b7d27c9300001a is STALE
/var/lib/openshift/498089529358545695277056 is STALE
/var/lib/openshift/395b727ece8611e2bafc22000a989659 is STALE
/var/lib/openshift/836749162193235549880320 is STALE
/var/lib/openshift/01942726ce8811e2bafc22000a989659 is STALE

real	0m15.259s
user	0m4.897s
sys	0m3.931s

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