Bug 455741 - Performance problem when attempting to remove packages for large number of systems using SSM
Summary: Performance problem when attempting to remove packages for large number of sy...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 0.1
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space02
TreeView+ depends on / blocked
 
Reported: 2008-07-17 14:31 UTC by Michael Mráka
Modified: 2009-09-17 06:59 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-17 06:59:33 UTC
Embargoed:


Attachments (Terms of Use)

Description Michael Mráka 2008-07-17 14:31:46 UTC
Description of problem:
Removing an installed package from ~7.300 systems lasts about 1 hour.
During this period system is unresponsive and heavy load is caused by oracle 
database.

As confirmed by statspack, the offending query is packages_from_server_set 
where it's trying to get a list of all packages from the selected systems.

/usr/lib/perl5/site_perl/5.8.5/RHN/DB/DataSource/xml/Package_queries.xml
...
<mode name="packages_from_server_set">
  <query params="user_id, set_label">
SELECT   PN.ID || '|' || PE.ID AS ID,
         PN.ID AS pn_id,
         PE.ID AS pe_id,
         PN.NAME,
         PE.VERSION,
         PE.release,
         PE.epoch,
         X.num_systems
    FROM rhnPackageName PN,
         rhnPackageEVR PE,
         (SELECT   SP.name_id,
                   SP.evr_id,
                   SP.package_arch_id,
                   COUNT (DISTINCT SP.server_id) num_systems
          FROM     rhnServerPackage SP,
                   rhnSet S,
                   rhnPackageArch PA,
                   rhnArchType AT
          WHERE    s.user_id = :user_id
          AND      s.label = :set_label
          AND      s.ELEMENT = SP.server_id
          AND      (   SP.package_arch_id IS NULL
                      OR EXISTS (
                                 SELECT 1
                                   FROM rhnPackageArch PA,
                                        rhnArchType AT
                                  WHERE PA.id = SP.package_arch_id
                                    AND AT.id = PA.arch_type_id
                                    AND (   AT.label = 'rpm'
                                         OR AT.label =
'sysv-solaris')))
          GROUP BY SP.name_id, SP.evr_id, SP.package_arch_id) X
   WHERE PE.ID = X.evr_id
     AND PN.ID = X.name_id
ORDER BY UPPER (PN.NAME)
  </query>
</mode>
...



Version-Release number of selected component (if applicable):
rhn-base-0.1-3

Comment 1 Michael Mráka 2008-07-17 14:34:13 UTC
More detailed description in private bug 453289.

Comment 2 Michael Mráka 2008-07-17 14:59:55 UTC
Fixed in git.
commit 3d201fa4c794e09fc1cb21d3fc45241964b57477

Comment 4 Miroslav Suchý 2009-09-17 06:59:33 UTC
Spacewalk is released for long time.


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