Project

General

Profile

Actions

Bug #25577

closed

Configure -> Smart class parameters page took long time to load

Added by Shimon Shtein over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Parameters
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1643847

Description of problem:
Configure -> Smart class parameters page may take long time to load when they are hundreds of puppet environments and puppet classes.

The issue appears to be the "eager_load" joins which may be very expensive when there are too many rows. When I try to use "includes" instead of eager_load, the page load many times faster. Previously it spent 170+ seconds to load the page, now only ~5seconds or less.

  1. diff u /tmp/puppetclass_lookup_keys_controller.rb.orig /usr/share/foreman/app/controllers/puppetclass_lookup_keys_controller.rb
    --
    /tmp/puppetclass_lookup_keys_controller.rb.orig 2018-10-29 18:06:04.103966839 1000
    ++ /usr/share/foreman/app/controllers/puppetclass_lookup_keys_controller.rb 2018-10-29 18:08:03.990375270 +1000
    @ -4,7 +4,7 @
    before_action :setup_search_options, :only => :index

    def index
    - @lookup_keys = resource_base_search_and_page(:param_classes).smart_class_parameters
    + @lookup_keys = resource_base_search_and_page.includes(:param_classes).distinct.smart_class_parameters
    @puppetclass_authorizer = Authorizer.new(User.current, :collection => @lookup_keys.map{|key| key.param_class.try(:id)}.compact.uniq)
    end

Actions #1

Updated by The Foreman Bot over 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6290 added
Actions #2

Updated by Tomer Brisker about 5 years ago

  • Fixed in Releases 1.21.0 added
Actions #3

Updated by Shimon Shtein about 5 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF