Postgresql percona 14.5 defunct processes

Hello team,
We are using postgresql 14.5 for one of our applications. we are using timescaledb extensions for a use case. we are freuqently observing messages like
worker took too long to start canceled and we see multiple defunct processess in postgres. We are unable to login to postgres and apps are also not able to connect. killing all the defunct processess is also not working. only killing the main postmaster process and restarting the database fixes the issue. we are facing this almost as frequently as 4 to 5 times a day. Any help would be appreciated



This sounds like deep analysis is required so I really don’t think I can give you an easy answer. What I can suggest however is install PMM and update your logging parameters in postgresql.conf in order to record and trend the behaviour. Look for locks and set timeouts.