我有 postgresql 9.6 ,它在ubuntu服务器16.04上运行,在AWS上有122gb RAM
,320gb SSD
,18 vCPU
。我想知道根据这些资源我需要在postgresql.config
文件中更改哪些参数才能获得高性能?
如何强制postgresql尽可能多地在内存中加载数据?
答案 0 :(得分:1)
为了快速入门,您可以使用pgtune util或web alternative http://pgtune.leopard.in.ua。 我们假设您编写了Web应用程序:
# WARNING
# this tool not being optimal
# for very high memory systems
max_connections = 200
shared_buffers = 31232MB
effective_cache_size = 93696MB
work_mem = 159907kB
maintenance_work_mem = 2GB
min_wal_size = 1GB
max_wal_size = 2GB
checkpoint_completion_target = 0.7
wal_buffers = 16MB
default_statistics_target = 100