The product listing page takes about 5-7 seconds to load with 10 custom products and 7 RH products enabled. It looks like the 'enabled=true' flag when calling the products API has something to do with this. For example: <pre> # time curl -sk 'https://admin:changeme@localhost/katello/api/products?organization_id=3&page=1&paged=true&search=&sort_by=name&sort_order=ASC' > /dev/null real 0m1.853s user 0m0.034s sys 0m0.024s # time curl -sk 'https://admin:changeme@localhost/katello/api/products?enabled=true&organization_id=3&page=1&paged=true&search=&sort_by=name&sort_order=ASC' > /dev/null real 0m4.246s user 0m0.024s sys 0m0.028s </pre> There is a 'self.enabled' method on the product model that may need investigation.
Created from redmine issue http://projects.theforeman.org/issues/14259
Upstream bug assigned to adprice
Moving to POST since upstream bug http://projects.theforeman.org/issues/14259 has been closed
second PR [1] merged to katello master. [1] https://github.com/Katello/katello/pull/6012
*** Bug 1271160 has been marked as a duplicate of this bug. ***
Created attachment 1163060 [details] Product page listing performance enabled=true does not seem to have a negative impact on performance when listing products any more. Verified on RHEL 7, snap 13.1
The patch works for me and reduces the time by 2.5 times. But it is still > 5 seconds that is expected to list 30 products as set on the expectation in the the marked as duplicate BZ1271160 Before the Patch: [crash] root@li-lc-1578:~# time curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://localhost/katello/api/v2/organizations/3/products | jq .total 36 real 0m20.379s user 0m0.184s sys 0m0.060s After the Patch: [crash] root@li-lc-1578:~# time curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://localhost/katello/api/v2/organizations/3/products | jq .total 36 real 0m8.492s user 0m0.192s sys 0m0.047s
The above test was with https://patch-diff.githubusercontent.com/raw/Katello/katello/pull/5991.diff applied. Now with also https://patch-diff.githubusercontent.com/raw/Katello/katello/pull/6012.diff is is slightly better, but still > 5 seconds: [crash] root@li-lc-1578:~# time curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://localhost/katello/api/v2/organizations/3/products | jq .total 36 real 0m6.724s user 0m0.185s sys 0m0.051s It is visible that with PR6012 applied that size is reduced from 24860 to 14216 bytes: Without PR6012: [crash] root@li-lc-1578:~# time curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://localhost/katello/api/v2/organizations/3/products | wc -c 24860 real 0m7.374s user 0m0.181s sys 0m0.057s With PR6012: [crash] root@li-lc-1578:~# time curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://localhost/katello/api/v2/organizations/3/products | wc -c 14216 real 0m6.348s user 0m0.180s sys 0m0.052s
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://access.redhat.com/errata/RHBA-2016:1501