Every SQL Server ships with a setting that lets it eat all your RAM. It's called max server memory and the default is 2,147,483,647 MB. Essentially: "take everything." Most people never change it. I've seen production outages caused by exactly this. That's just one of five misconfigurations we find on almost every SQL Server we scan. The others: - Optimize for Ad Hoc Workloads disabled (plan cache bloated with thousands of single-use plans) - TempDB running on a single file (hello PAGELATCH waits) - Auto-Shrink enabled (silently fragmenting your indexes in a loop) - Cost Threshold for Parallelism still at 5 (parallelizing queries that would run faster on one core) The frustrating thing? All five take less than a minute to fix. One line of T-SQL each. But they go unnoticed for years because nothing alerts on them; they just quietly degrade performance. After 15+ years of reviewing SQL Servers, I'd estimate 90% of instances have at least two of these. Some have all five. Full write-up with the T-SQL fixes for each one: https://lnkd.in/eX_jMHc4 #SQLServer #DatabasePerformance #DBA
I wrote the code for this one: - Optimize for Ad Hoc Workloads disabled (plan cache bloated with thousands of single-use plans) ~20 years ago! The SQL team hasn't made it the default in all these years eh.
symplr•427 followers
1moI'll give you the Cost Threshold for Parallelism and Max Degree of Parallelism, but if you can get the manual installation of SQL 2019 or later to not suggest a lower RAM setting than the old 2,147,483,647 MB RAM and the same number of TempDB Data files as you have CPU, maxing out at 8, then you've seen something I have not. That said, TempDB file allocation, Memory, CTFP, and MaxDOP are the first settings that I check as soon as anyone reports there are performance issues. After that I start running sp_blitzfirst @SinceStartup (Thank you Brent Ozar) and chip away at the wait types there. (Brent's First Responder Kit https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/releases) New tool in my arsenal is Erik Darling's PerformanceMonitor and find out what Databases or queries are causing issues (https://github.com/erikdarlingdata/PerformanceMonitor). *This does need Query Store Enabled for the best details. By the way, thank you, Erik Darling, for the tooling! (It was implied, but not stated)