BUG #17776: Connections are terminated unexpectedly sometimes

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: fran(dot)tm213(at)gmail(dot)com
Subject: BUG #17776: Connections are terminated unexpectedly sometimes
Date: 2023-02-06 11:17:13
Message-ID: 17776-36d858c9afa20043@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17776
Logged by: Francesco Tagliani
Email address: fran(dot)tm213(at)gmail(dot)com
PostgreSQL version: 14.6
Operating system: Ubuntu 20
Description:

I am running Ruby on Rails app with postgresql 14.6 on ubuntu 20.
For some reason, the connections are terminated unexpectedly while running a
background job.
Regarding background job, it requires around 100~200 connections over
6~7hrs.

I've installed pghero and configured postgresql based on
pgtune(https://pgtune.leopard.in.ua/)
This is current configuration

# DB Version: 14
# OS Type: linux
# DB Type: web
# Total Memory (RAM): 48 GB
# CPUs num: 12
# Connections num: 1000
# Data Storage: hdd

max_connections = 1000
shared_buffers = 12GB
effective_cache_size = 36GB
maintenance_work_mem = 2GB
checkpoint_completion_target = 0.9
wal_buffers = 16MB
default_statistics_target = 100
random_page_cost = 4
effective_io_concurrency = 2
work_mem = 3145kB
min_wal_size = 1GB
max_wal_size = 4GB
max_worker_processes = 12
max_parallel_workers_per_gather = 4
max_parallel_workers = 12
max_parallel_maintenance_workers = 4

I've checked postgresql log around that time.

2023-02-06 06:45:41.702 UTC [341438] user(at)db_production LOG: could not
receive data from client: Connection reset by peer
2023-02-06 08:26:56.134 UTC [352190] user(at)db_production LOG: could not
receive data from client: Connection reset by peer
2023-02-06 08:26:56.134 UTC [352191] user(at)db_production LOG: could not
receive data from client: Connection reset by peer

And I can not find other logs.
Can you please advise me how to debug this issue or fix this issue?

Thanks

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Masahiko Sawada 2023-02-06 14:18:02 Re: WAL segments removed from primary despite the fact that logical replication slot needs it.
Previous Message hubert depesz lubaczewski 2023-02-06 11:15:52 Re: WAL segments removed from primary despite the fact that logical replication slot needs it.