[katello 3.0.2] Slow dashboard

Hello,

i just did a new setup of katello 3.0.2. After setting up everything i
started registering hosts (both for contents and configuration management).
At the moment ~300 servers are registered. Now logging into katello is very
slow (requires about 30s) due to dashboard.
While waiting the dashboard to appear i see that there is a postgresql
SELECT process that is using 100% of CPU for several time.
However accessing directly to /hosts is very fast and so as far as i can
experiment is related only to dashboard tasks.

What can i do? Some parts of dashboard can be useful, but not if is this
slow.

Luca

Can you enable slow sql logging?

It is set in /var/lib/pgsql/data/postgresql.conf, setting
log_min_duration_statement to 100 or 250 should do the trick. Once it is
set, you will need to do a "service postgresql reload" to pick up the
change, then try to load the dashboard again.

The log should be in /var/lib/pgsql/data/pg_log/postgresql-<day of week>.log

The issue you hit might be fixed in Katello 3.1, but if we get the SQL
then we can know for sure.

Thanks!

··· On 09/02/2016 05:11 AM, Luca Lorenzetto wrote: > Hello, > > i just did a new setup of katello 3.0.2. After setting up everything i > started registering hosts (both for contents and configuration management). > At the moment ~300 servers are registered. Now logging into katello is very > slow (requires about 30s) due to dashboard. > While waiting the dashboard to appear i see that there is a postgresql > SELECT process that is using 100% of CPU for several time. > However accessing directly to /hosts is very fast and so as far as i can > experiment is related only to dashboard tasks. > > What can i do? Some parts of dashboard can be useful, but not if is this > slow. > > Luca >

[cut]
> Can you enable slow sql logging?
>

Yes, done.

> It is set in /var/lib/pgsql/data/postgresql.conf, setting
> log_min_duration_statement to 100 or 250 should do the trick. Once it is
> set, you will need to do a "service postgresql reload" to pick up the
> change, then try to load the dashboard again.
>
> The log should be in /var/lib/pgsql/data/pg_log/postgresql-<day of week>.log
>

LOG: duration: 188745.456 ms execute <unnamed>: SELECT DISTINCT
"katello_errata".* FROM "katello_errata" INNER JOIN
"katello_content_facet_errata" ON
"katello_content_facet_errata"."erratum_id" = "katello_errata"."id"
INNER JOIN "katello_content_facet_errata"
"content_facet_errata_katello_errata_join" ON
"content_facet_errata_katello_errata_join"."erratum_id" =
"katello_errata"."id" INNER JOIN "katello_content_facets" ON
"katello_content_facets"."id" =
"content_facet_errata_katello_errata_join"."content_facet_id" WHERE
"katello_content_facets"."host_id" IN (SELECT "hosts"."id" FROM
"hosts" WHERE "hosts"."type" IN ('Host::Managed') AND
"hosts"."organization_id" IN (3)) ORDER BY updated desc LIMIT 6

> The issue you hit might be fixed in Katello 3.1, but if we get the SQL
> then we can know for sure.

Can you tell if it's so?

Luca

··· On Fri, Sep 2, 2016 at 2:32 PM, Chris Duryee wrote:


"E’ assurdo impiegare gli uomini di intelligenza eccellente per fare
calcoli che potrebbero essere affidati a chiunque se si usassero delle
macchine"
Gottfried Wilhelm von Leibnitz, Filosofo e Matematico (1646-1716)

"Internet è la più grande biblioteca del mondo.
Ma il problema è che i libri sono tutti sparsi sul pavimento"
John Allen Paulos, Matematico (1945-vivente)

Luca ‘remix_tj’ Lorenzetto, http://www.remixtj.net , lorenzetto.luca@gmail.com

> [cut]
>> Can you enable slow sql logging?
>>
>
> Yes, done.
>
>> It is set in /var/lib/pgsql/data/postgresql.conf, setting
>> log_min_duration_statement to 100 or 250 should do the trick. Once it is
>> set, you will need to do a "service postgresql reload" to pick up the
>> change, then try to load the dashboard again.
>>
>> The log should be in /var/lib/pgsql/data/pg_log/postgresql-<day of week>.log
>>
>
>
> LOG: duration: 188745.456 ms execute <unnamed>: SELECT DISTINCT
> "katello_errata".* FROM "katello_errata" INNER JOIN
> "katello_content_facet_errata" ON
> "katello_content_facet_errata"."erratum_id" = "katello_errata"."id"
> INNER JOIN "katello_content_facet_errata"
> "content_facet_errata_katello_errata_join" ON
> "content_facet_errata_katello_errata_join"."erratum_id" =
> "katello_errata"."id" INNER JOIN "katello_content_facets" ON
> "katello_content_facets"."id" =
> "content_facet_errata_katello_errata_join"."content_facet_id" WHERE
> "katello_content_facets"."host_id" IN (SELECT "hosts"."id" FROM
> "hosts" WHERE "hosts"."type" IN ('Host::Managed') AND
> "hosts"."organization_id" IN (3)) ORDER BY updated desc LIMIT 6
>
>
>
>
>> The issue you hit might be fixed in Katello 3.1, but if we get the SQL
>> then we can know for sure.
>
> Can you tell if it's so?

ya, it should be fixed by Bug #15389: errata page broken - Katello - Foreman
which is marked for 3.1.0.

··· On 09/02/2016 08:48 AM, Luca 'remix_tj' Lorenzetto wrote: > On Fri, Sep 2, 2016 at 2:32 PM, Chris Duryee wrote:

Luca

Merging manually this fix is an option?

··· On Fri, Sep 2, 2016 at 2:53 PM, Chris Duryee wrote: > > ya, it should be fixed by http://projects.theforeman.org/issues/15389 > which is marked for 3.1.0. > >>


"E’ assurdo impiegare gli uomini di intelligenza eccellente per fare
calcoli che potrebbero essere affidati a chiunque se si usassero delle
macchine"
Gottfried Wilhelm von Leibnitz, Filosofo e Matematico (1646-1716)

"Internet è la più grande biblioteca del mondo.
Ma il problema è che i libri sono tutti sparsi sul pavimento"
John Allen Paulos, Matematico (1945-vivente)

Luca ‘remix_tj’ Lorenzetto, http://www.remixtj.net , lorenzetto.luca@gmail.com

If you wait a while, let the dashboard page load, and remove the errata
widget, that should provide temporary relief.

-salman

··· On Fri, Sep 2, 2016 at 9:05 AM, Luca 'remix_tj' Lorenzetto < lorenzetto.luca@gmail.com> wrote:

On Fri, Sep 2, 2016 at 2:53 PM, Chris Duryee cduryee@redhat.com wrote:

ya, it should be fixed by Bug #15389: errata page broken - Katello - Foreman
which is marked for 3.1.0.

Merging manually this fix is an option?


"E’ assurdo impiegare gli uomini di intelligenza eccellente per fare
calcoli che potrebbero essere affidati a chiunque se si usassero delle
macchine"
Gottfried Wilhelm von Leibnitz, Filosofo e Matematico (1646-1716)

"Internet è la più grande biblioteca del mondo.
Ma il problema è che i libri sono tutti sparsi sul pavimento"
John Allen Paulos, Matematico (1945-vivente)

Luca ‘remix_tj’ Lorenzetto, http://www.remixtj.net , <
lorenzetto.luca@gmail.com>


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.