Re: many sessions wait on LWlock WALWrite suddenly

2025-04-11 Thread MichaelDBA
LWLock always shows up in the case where you have too many concurrent active connections.  Do a select from the pg_stat_activity table where state in ('idle in transaction','active'); Then count how many CPUs you have. If the sql query count returned is greater than 2-3 times the number of CPUs, y

Re: many sessions wait on LWlock WALWrite suddenly

2025-04-11 Thread Laurenz Albe
On Fri, 2025-04-11 at 22:36 +0800, James Pang wrote: > pgv14.8 , during peak time, we suddenly see hundreds of active sessions > waiting on LWlock > WALWrite at the same time, but we did not find any issue on storage . > any suggestions ?  You should get a reasonably sized (much smaller) connecti

many sessions wait on LWlock WALWrite suddenly

2025-04-11 Thread James Pang
pgv14.8 , during peak time, we suddenly see hundreds of active sessions waiting on LWlock WALWrite at the same time, but we did not find any issue on storage . any suggestions ? Thanks, James