Bug 980497 - [PERF] Avoid expensive operations in oo-scheduled-jobs when there's no job to be run
Summary: [PERF] Avoid expensive operations in oo-scheduled-jobs when there's no job to...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Rob Millner
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-02 14:16 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:
Environment:
Last Closed: 2013-07-22 15:19:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Andy Grimm 2013-07-02 14:16:47 UTC
In the run_user_scheduled_jobs function of oo-scheduled jobs, there are two function calls which run under conditions when they are not needed:  both setup_user_vars and setuppam should only be called in the same "if" block as daemon_as_user (and maybe those calls should even be moved into the daemon_as_user function).  Each call to setup_user_vars takes about 0.5 seconds of CPU time, and there are hundreds of these calls per hour, when most gears don't even use cron.

Comment 1 Rob Millner 2013-07-08 18:51:23 UTC
The setuppam call was unnecessary, I got rid of it.  We'll see what can be done to reorder the logic so that setup_user_vars is only called when needed.

Comment 2 Rob Millner 2013-07-10 03:05:57 UTC
Pull request.
https://github.com/openshift/origin-server/pull/3030

Comment 3 openshift-github-bot 2013-07-10 10:41:00 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/b60e7e11f8c9c1e8b812bcb77d817c9a3fcca9e6
Bug 980497 - Optimize these calls to oo-get-mcs-level.

Comment 4 Meng Bo 2013-07-11 12:37:24 UTC
Test the oo-scheduled-jobs for specified gear.

On last stage_ami:
#time oo-scheduled-jobs run-user cbb668daea2511e2922622000aa43988 1000

real	0m1.823s
user	0m0.495s
sys	0m0.161s


On latest devenv_ami:
#time oo-scheduled-jobs run-user 591008146458654193745920 1000

real	0m0.167s
user	0m0.075s
sys	0m0.079s


The run time reduced.

Move bug to verified.


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