RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 976855 - (client) version checks done at startup are very slow
Summary: (client) version checks done at startup are very slow
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel72
TreeView+ depends on / blocked
 
Reported: 2013-06-21 16:17 UTC by Adrian Likins
Modified: 2015-07-22 06:51 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-22 06:51:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
pycallgraph output showing client version loading info dominating time spent (33.47 KB, application/pdf)
2013-06-21 16:28 UTC, Adrian Likins
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1345 0 normal SHIPPED_LIVE subscription-manager and python-rhsm bug fix and enhancement update 2015-07-20 17:59:53 UTC

Description Adrian Likins 2013-06-21 16:17:21 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Adrian Likins 2013-06-21 16:27:34 UTC
(er, oops)

Description:

At startup, subscription-manager finds the version of subscription-manager and python-rhsm, and the version of the candlepin server it uses.

The client checks check the rpm database for the versions of the packages. This can be slow (~.75 secs or more). This is a blocking operation, and adds significant latency to the startup of the app.

For cli invocations especially, this can actually be the majority of the time spent in the application. 

See attached "pycallgraph-list-installed.pdf" for an example of the version checking taking .8s on startup. In this case, the entire invocation was only .9s, so the version check is the majority of the time spent in the application.


Possible fixes:

1. instead of checking rpmdb via it's api, just include the version strings into the python modules at build time. This would reduct the client version check time to almost nothing. 

2

Comment 2 Adrian Likins 2013-06-21 16:28:13 UTC
Created attachment 763909 [details]
pycallgraph output showing client version loading info dominating time spent

Comment 3 Bryan Kearney 2013-07-18 20:52:47 UTC
moving to rhel7

Comment 5 Bryan Kearney 2014-03-19 20:49:45 UTC
Moving bugs from 7.0 to 7.1

Comment 7 Bryan Kearney 2014-07-30 19:21:10 UTC
Acking 7.1

Comment 10 Devan Goodwin 2014-11-21 15:39:42 UTC
Simple fix and good time savings. Devel ack.

Comment 11 Adrian Likins 2015-03-02 14:30:32 UTC
in upstream master and versions >= 1.14.1-1

commit 1ba2d37da42b69c48b9034f7751c500f9422be46
Author: Adrian Likins <alikins>
Date:   Fri Jun 21 16:43:07 2013 -0400

    976855: populate a "version.py" at build time
    
    Instead of asking the rpm db for the versions
    of "subsciption-manager" and "python-rhsm", we
    generate a versions.py at build time with that
    info.
    
    "make set-versions" is the make target that
    does it. It will use VERSION from the env
    (the spec file passes this in), or if
    not specified, it will build one based
    on 'git describe'.
    
    This removes code that was on average spending
    about .5s every time we started up (including
    cli). This reduces it to basically nothing.
    
    This requires latest python-rhsm (>= 1.8.14-1)

Comment 14 Shwetha Kallesh 2015-05-08 12:45:45 UTC
Marking verified!!

With python-rhsm version < 1.8.14-1:

[root@hp-dl380pgen8-01 ~]# time subscription-manager version
server type: This system is currently not registered.
subscription management server: 0.9.26.8-1
subscription management rules: 5.12
subscription-manager: 1.12.14-9.el6_6
python-rhsm: 1.13.8-1.el6

real	0m1.308s
user	0m0.364s
sys	0m0.060s



With python-rhsm version > 1.8.14-1:

[root@hp-dl380pgen8-01 ~]# time subscription-manager version
server type: This system is currently not registered.
subscription management server: 0.9.26.8-1
subscription management rules: 5.12
subscription-manager: 1.14.6-1.el6
python-rhsm: 1.14.2-1.el6

real	0m1.084s
user	0m0.297s
sys	0m0.036s

Comment 15 errata-xmlrpc 2015-07-22 06:51:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1345.html


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