Bug 2033593
Summary: | fact_values api performance issues when loading a large number of facts | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Kenny Tordeurs <ktordeur> |
Component: | Fact | Assignee: | Tomer Brisker <tbrisker> |
Status: | CLOSED ERRATA | QA Contact: | Jan HutaĆ <jhutar> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.9.7 | CC: | jhutar, lvrtelov, mhulan, pcreech, peter.vreman, zhunting |
Target Milestone: | 6.11.0 | Keywords: | Performance, Triaged |
Target Release: | Unused | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2022-07-05 14:31:10 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Kenny Tordeurs
2021-12-17 11:31:23 UTC
Before the patch from https://github.com/theforeman/foreman/pull/9000.patch # curl -X GET -s -k -u admin:pass https://ktordeur-satellite.example.lan/api/v2/fact_values\?per_page\=99999999 | python -m json.tool ~~~ 2021-12-17T12:45:47 [I|app|85ed1fcd] Started GET "/api/v2/fact_values?per_page=99999999" for 10.40.194.212 at 2021-12-17 12:45:47 +0100 2021-12-17T12:45:47 [I|app|85ed1fcd] Processing by Api::V2::FactValuesController#index as JSON 2021-12-17T12:45:47 [I|app|85ed1fcd] Parameters: {"per_page"=>"99999999", "apiv"=>"v2"} 2021-12-17T12:45:47 [I|app|85ed1fcd] Authorized user admin(Admin User) 2021-12-17T12:45:48 [I|app|85ed1fcd] Rendering api/v2/fact_values/index.json.rabl within api/v2/layouts/index_layout 2021-12-17T12:45:48 [I|app|85ed1fcd] Rendered api/v2/fact_values/index.json.rabl within api/v2/layouts/index_layout (Duration: 23.2ms | Allocations: 12917) 2021-12-17T12:45:48 [I|app|85ed1fcd] Completed 200 OK in 650ms (Views: 42.1ms | ActiveRecord: 62.3ms | Allocations: 212369) ~~~ After the patch: ~~~ 2021-12-17T13:11:47 [I|app|82f50291] Started GET "/api/v2/fact_values?per_page=99999999" for 10.44.129.52 at 2021-12-17 13:11:47 +0100 2021-12-17T13:11:47 [I|app|82f50291] Processing by Api::V2::FactValuesController#index as JSON 2021-12-17T13:11:47 [I|app|82f50291] Parameters: {"per_page"=>"99999999", "apiv"=>"v2"} 2021-12-17T13:11:47 [I|app|82f50291] Authorized user admin(Admin User) 2021-12-17T13:11:47 [I|app|82f50291] Rendering api/v2/fact_values/index.json.rabl within api/v2/layouts/index_layout 2021-12-17T13:11:47 [I|app|82f50291] Rendered api/v2/fact_values/index.json.rabl within api/v2/layouts/index_layout (Duration: 11.0ms | Allocations: 12880) 2021-12-17T13:11:47 [I|app|82f50291] Completed 200 OK in 243ms (Views: 18.1ms | ActiveRecord: 32.5ms | Allocations: 138916) ~~~ Upstream bug assigned to tbrisker Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34160 has been resolved. Thanks for the quick follow-up and preparing a code fix I applied the patch on 2 sat6 instances one smaller running 6.9.7 and larger one running 6.9.6 and can confirm it gives a big improvement: The 6.9.7 instance has 45000 facts goes from ~7sec -> ~1.5sec allocations ~6000000 -> 4000000 The 6.9.6 instance has 125000 facts goes from ~40sec -> ~5sec allocations 2200000 -> 1500000 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 (Moderate: Satellite 6.11 Release), 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://access.redhat.com/errata/RHSA-2022:5498 |