Re: Slow query after 9.3 to 9.6 migration

From: Kevin Grittner <kgrittn(at)gmail(dot)com>
To: Flávio Henrique <yoshimit(at)gmail(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Slow query after 9.3 to 9.6 migration
Date: 2017-01-05 17:10:57
Message-ID: CACjxUsPd0nsLh37tpP+9dU92EYUAujSuhrEvncej_=EsSKiQ9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Jan 5, 2017 at 10:51 AM, Flávio Henrique <yoshimit(at)gmail(dot)com> wrote:

> Replying your comment, I think they tunned the server:
> effective_cache_size = 196GB
> shared_buffers = 24GB (this shouldn't be higher?)

Probably not, although it may be a good idea to try settings either
side of that (say, 16GB and 32GB) and monitor performance compared
to the current setting.

> autovacuum_max_workers |3

If you ever see all workers busy at the same time for 30 minutes or
more, you should probably consider raising that so that small,
frequently updated tables are not neglected for too long.

> autovacuum_vacuum_cost_limit |-1

That is going to default to vacuum_cost_limit, which is usually
200. If the server is actually big enough to merit
"effective_cache_size = 196GB" then you should probably bump this
setting to something like 2000.

> autovacuum_work_mem |-1

That is going to default to maintenance_work_mem. On a big
machine, you probably want that set to somewhere between 1GB and
2GB.

Some other tuning to the cost parameters might be helpful, but
there's not enough data on the thread to know what else to suggest.
If you hit some other slow query, you might want to report it in
the manner suggested here:

https://wiki.postgresql.org/wiki/SlowQueryQuestions

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Daniel Blanch Bataller 2017-01-05 17:51:10 Re: Slow query after 9.3 to 9.6 migration
Previous Message Flávio Henrique 2017-01-05 16:51:41 Re: Slow query after 9.3 to 9.6 migration