Bug #18851

viewing REX job in web UI is very slow as non-admin user

Added by Ivan Necas 22 days ago. Updated 21 days ago.

Status:Closed
Priority:High
Assigned To:Ivan Necas
Category:-
Target version:Foreman - Team Ivan Iteration 11
Difficulty: Pull request:https://github.com/theforeman/foreman_remote_execution/pull/236
Bugzilla link:1422690
Story points-
Velocity based estimate-
Releaseforeman_remote_execution 1.3.0Release relationshipAuto

Description

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

Description of problem:

If you have a non-admin user with rights to view REX jobs, it can be very slow to view the task output. For example:

Rendered /opt/.../app/views/job_invocations/_tab_overview.html.erb (23.2ms)
Rendered /opt/.../app/views/job_invocations/_host_name_td.html.erb (3065.9ms)
Rendered /opt/.../app/views/job_invocations/_host_status_td.html.erb (0.5ms)
Rendered /opt/.../app/views/job_invocations/_host_actions_td.html.erb (3587.1ms)
Rendered /opt/.../app/views/job_invocations/_host_name_td.html.erb (2876.5ms)
Rendered /opt/.../app/views/job_invocations/_host_status_td.html.erb (0.5ms)
Rendered /opt/.../app/views/job_invocations/_host_actions_td.html.erb (2717.4ms)
Rendered /opt/.../app/views/job_invocations/_host_name_td.html.erb (3664.2ms)
Rendered /opt/.../app/views/job_invocations/_host_status_td.html.erb (0.4ms)
Rendered /opt/.../app/views/job_invocations/_host_actions_td.html.erb (2913.4ms)
Rendered /opt/.../app/views/job_invocations/_host_name_td.html.erb (2749.4ms)
Rendered /opt/.../app/views/job_invocations/_host_status_td.html.erb (0.5ms)
Rendered /opt/.../app/views/job_invocations/_host_actions_td.html.erb (3694.2ms)
Rendered /opt/.../app/views/job_invocations/_host_name_td.html.erb (2884.7ms)
Rendered /opt/.../app/views/job_invocations/_host_status_td.html.erb (0.5ms)
Rendered /opt/.../app/views/job_invocations/_host_actions_td.html.erb (2732.3ms)
Rendered /opt/.../app/views/job_invocations/_host_name_td.html.erb (3653.0ms)
Rendered /opt/.../app/views/job_invocations/_host_status_td.html.erb (0.5ms)
Rendered /opt/.../app/views/job_invocations/_host_actions_td.html.erb (2917.3ms)
Rendered /opt/.../app/views/job_invocations/_tab_hosts.html.erb (37465.4ms)
Rendered /opt/.../app/views/job_invocations/show.html.erb within layouts/application (37502.5ms)
Rendered layouts/_application_content.html.erb (0.2ms)
Rendered home/_submenu.html.erb (1.4ms)
Rendered home/_user_dropdown.html.erb (2.5ms)
Read fragment views/tabs_and_title_records-21 (0.1ms)
Rendered home/_topbar.html.erb (6.4ms)
Rendered layouts/base.html.erb (7.2ms)
Completed 200 OK in 37539ms (Views: 37366.9ms | ActiveRecord: 148.5ms)

If you are logged in as admin, this takes less than one second:

Completed 200 OK in 67ms (Views: 47.9ms | ActiveRecord: 6.9ms)

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

Steps to Reproduce:
1. register a large number of hosts to the satellite (perhaps 40K or more)
2. view rex job. The job doesn't have to be on a large number of hosts, the example above was for 7 hosts.

Actual results: page seems to take 3-5 seconds per host

Expected results: page should be about the same speed as for admin user

Additional info: attached patch seems to help significatly

Associated revisions

Revision 21dcd1c3
Added by Ivan Necas 21 days ago

Fixes #18851 - provide authorizer to avoid large requests

Otherwise, the authorization calculation could be very slow.

History

#1 Updated by The Foreman Bot 22 days ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Ivan Necas
  • Pull request https://github.com/theforeman/foreman_remote_execution/pull/236 added

#2 Updated by Ivan Necas 22 days ago

  • Subject changed from viewing REX job in web UI is very slow as non-admin user to viewing REX job in web UI is very slow as non-admin user
  • Target version set to Team Ivan Iteration 11

#3 Updated by Ivan Necas 21 days ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Ivan Necas 21 days ago

  • Release set to foreman_remote_execution 1.3.0

Also available in: Atom PDF