Sample Header Ad - 728x90

PG 13 write performance deteriorates after OS Upgrade Win Server 2012r2 to 2019 with LWLock WALWrite statuses

2 votes
1 answer
66 views
I've upgraded the OS on PG database server from Win Server 2012r2 Standard to 2019 Standard. Nothing else was changed. Now I see write throughput deteriorates greatly during peak update times with multiple connections in "LWLock WALWrite" status. Config: Postgresql 13.18 Hardware: Dell R740xd 768GB RAM 2 x 28 core CPU (so 56 cores, 112 threads), SSD RAID 10 storage. Previous to the upgrade the server ran well with no problems. I don't believe that I ever saw the connection status "LWLock WALWrite" under win 2012r2. During the problem episodes, CPU usage halves suddenly for a few seconds, then returns, then repeats - almost looks like a square wave. Removing writers clears things up. In general, CPU usage does not exceed 35% Reviewing the changelog for lwlock.c, appears that performance enhancements were made in Rev 13.14 by Andres Freund and also this change by Michael Paquier which does not appear to have made it into the PG 13 branch. Questions: 1. Given my ability to understand the PG source code is limited, does lwlock.c depend on an operating system primitive that could have been affected by the OS upgrade? In other words, is there an explanation for this issue that can be tied to the OS upgrade? 2. Is there anything I can try to mitigate this issue?
Asked by sevzas (373 rep)
Apr 30, 2025, 12:31 PM
Last activity: May 1, 2025, 07:14 AM