Hello,
I have recently deployed a new Slave (streaming replication) and have been monitoring its cache hit ratio.
At the moment, read-only queries are being sent to this slave but only 10% of the traffic.
The cache hit ratio is now at 82%. This database is around 1.4TB and is running on EC2 instances in AWS. PostgreSQL version is 9.2.24.
The instance is a r4.2xlarge, so it's got 8 vCPUs and 61GB of RAM. The postgresql.conf file can be seen below (will show only relevant parameters for the cache/performance):
hot_standby = onrandom_page_cost = 1.1max_connections = 500shared_buffers = 15GBstatement_timeout = 0work_mem = 31457kBmaintenance_work_mem = 2GBwal_level = hot_standbyfsync = onsynchronous_commit = onwal_buffers = 16MBcheckpoint_segments = 32checkpoint_completion_target = 0.9max_wal_senders = 20wal_keep_segments = 1024effective_cache_size = 45GBlogging_collector = onautovacuum = onlog_autovacuum_min_duration = 1000autovacuum_max_workers = 5autovacuum_naptime = 40sautovacuum_vacuum_threshold = 200autovacuum_analyze_threshold = 150autovacuum_vacuum_scale_factor = 0.02autovacuum_analyze_scale_factor = 0.005deadlock_timeout = 2smax_files_per_process = 4096effective_io_concurrency = 200hot_standby_feedback = onmax_standby_streaming_delay = 120sdefault_statistics_target = 100
I have tried reducing the shared_buffers parameter from 15GB to 8GB, but the cache hit ratio went down to 60%.
Do you guys have any suggestions, on what I could try to get this cache more hits?
Thanks in advance!
---
Regards,
Lucas
This message is encrypted. Both the Public Key and the GPG encrypted message are included in this email so that you can verify its origin.
Attachment:
publickey - root@sud0.nz - 0xC5E964A1.asc
Description: application/pgp-keys
Attachment:
signature.asc
Description: OpenPGP digital signature