PostgreSQL 9.3.2 Performance issues

Поиск
Список
Период
Сортировка
Искать

PostgreSQL 9.3.2 Performance issues

От:
<fburgess@radiantblue.com>
Дата:
We have 64GB of Memory on RHEL 6.4

shared_buffers = 8GB
work_mem = 64MB
maintenance_work_mem = 1GB
effective_cache_size = 48GB

I found this list of recommended parameters for memory management in PostgreSQL.

About shared_buffers:
  • Below 2GB, set to 20% of total system memory.
  • Below 32GB, set to 25% of total system memory.
  • Above 32GB, set to 8GB
About work_mem, this parameter can cause a huge speed-up if set properly, however it can use that amount of memory per planning node.
Here are some recommendations to set it up.
  • Start low: 32-64MB
  • Look for ‘temporary file’ lines in logs
  • Set to 2-3x the largest temp file
About maintenance_work_mem, some recommendations were:
  • 10% of system memory, up to1GB
  • Maybe even higher if you are having VACUUM problems
About effective_cache_size, guidelines suggested.
  • Set to the amount of file system cache available
  • If you don’t know, set it to 50% of total system memory
We have real time 24/7 data ingest processes running on our 9.3.2 database 7TB in size

Do these settings look correct for 9.3.2?

thanks

Re: PostgreSQL 9.3.2 Performance issues

От:
Kevin Grittner <kgrittn@ymail.com>
Дата:
"fburgess@radiantblue.com"  wrote:

> We have 64GB of Memory on RHEL 6.4
>
> shared_buffers = 8GB
> work_mem = 64MB
> maintenance_work_mem = 1GB
> effective_cache_size = 48GB

> Do these settings look correct for 9.3.2?

Maybe.

What is your max_connections setting?

I find that a good place to start with work_mem is to ignore the
factors you quoted, and to set it somewhere near 25% of machine RAM
divided by max_connections.  It might be possible to go up from
there, but monitor closely for peaks of activity which cause enough
memory allocation to flush the OS cache and cause high disk read
rates, killing performance until the cache repopulates.  The can
take a while since the high disk read rates slow queries, causing
more of them to compete, leading to higher total work_mem
allocations, and thus preventing recovery from the performance
degradation.  In other words, setting this too high leads to
unstable performance.  It looks better than a lower setting until
too many users hit Enter at about the same time, causing
performance to collapse for a while.

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

FAQ