Bug 971159 - find command in oo-auto-idler is very inefficient
Summary: find command in oo-auto-idler is very inefficient
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Mrunal Patel
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1034436
TreeView+ depends on / blocked
 
Reported: 2013-06-05 20:27 UTC by Andy Grimm
Modified: 2016-11-08 03:47 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1034436 (view as bug list)
Environment:
Last Closed: 2013-06-11 04:00:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Andy Grimm 2013-06-05 20:27:57 UTC
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-06 00:34:03 UTC
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 10:12:57 UTC
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.