I have a AWS instance running Postgres 9.3 with 4GB of memory and 2 vCPUs. There seems to be a tipping point where heavy load tests cause postmaster processes start consuming all of memory and eventually all of swap (1GB). I think the values in the postgresql.conf file look pretty conservative for that amount of memory.
I even have tried dropping shared_buffers to 2GB, max_connections to 20...no effect it just keeps eating memory and swap.
It should be noted that I've got 100 schemas. Can anyone spot something I am missing?
archive_command = 'cd .'
archive_mode = on
archive_timeout = 300
checkpoint_completion_target = 0.9
checkpoint_segments = 64
datestyle = 'iso, mdy'
default_statistics_target = 100
default_text_search_config = 'pg_catalog.english'
effective_cache_size = 3GB
hot_standby = on
lc_messages = 'en_US.UTF-8'
lc_monetary = 'en_US.UTF-8'
lc_numeric = 'en_US.UTF-8'
lc_time = 'en_US.UTF-8'
listen_addresses = '*'
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
logging_collector = on
log_rotation_age = 1d
log_rotation_size = 0
log_timezone = 'UTC'
log_truncate_on_rotation = on
maintenance_work_mem = 256MB
max_connections = 80
max_wal_senders = 10
password_encryption = on
shared_buffers = 1GB
shared_preload_libraries = 'repmgr_funcs'
timezone = 'UTC'
track_activities = on
track_counts = on
track_io_timing = on
wal_buffers = 16MB
wal_keep_segments = 288
wal_level = 'hot_standby'
max_locks_per_transaction=256
work_mem = 4MB