Presentation on theme: "Memory Management in SQL Server Analysis Services"— Presentation transcript:
1 Memory Management in SQL Server Analysis Services Steve WrightDirector of Product SupportSQL Sentry, Inc.
2 About the PresenterSteve Wright – Director of Product Support for SQL Sentry Inc.Headquartered in Huntersville, NCSQL Sentry provides tools to monitor your entire Microsoft BI Platform
3 About this presentation… We will discuss methods used to manage memory in SQL Server Analysis ServicesExpected behavior when applying these methods.How to monitor that behaviorExamples of Issues when these methods are mis-applied.
4 SSAS Memory Categories ShrinkableEasily reduced and returned to the OSSE and FE cachesNonshrinkableUsed for more essential system-related activitesMemory AllocatorsMetadata ObjectsNot easily reduced.
6 SSAS Memory LimitsUsed to determine how to allocate and manage internal memoryConfigurable with SSAS properties with SSMS or edit msmdsrv.iniMemory\LowMemoryLimitMemory\TotalMemoryLimitRefers to physical memory on the server
7 Memory\LowMemoryLimit Default Value 65 in SSAS2008, 75 in SSAS2005Percentage if between 0 and 100.Bytes if greater than 100.Refers to total physical memory on machine
8 Memory\TotalMemoryLimit Default Value 80Percentage if between 0 and 100.Bytes if greater than 100.Total amount of memory the SSAS process(msmdsrv.exe) can consume.
9 Total Memory Limit cont. If set to 0, SSAS will use no memory for cachingTotal available to SSAS depends on platform32-bit limited to 3GB with /Gb switch enabled64-bit provides all memory available
10 Behavior – Low Limit Reached Cleaner threads start moving data out of memory (non-aggresively)Perfmon – MSOLAP$SQL:Memory > Cleaner Memory Shrunk KB/sec
11 Behavior – Total Limit Reached Cleaner goes into crisis modeMore aggressive cleanupMore threads spawnedDramatic performance impact
12 Behavior Between Low and Total Economic memory managementMemory Price per KBDepends on amount available based on limitsMemory is free and the livin’ is easy under the Low Limit!Memory price begins to increase as total memory increases between Low and Total.
13 SSAS Memory Management Self governing – no consideration for low physical memory conditionsWindows File CacheUnlike SQL Server, SSAS DB’s are collection of files on files system and use file system cacheSSAS data may be loaded in RAM as file cacheNot part of SSAS process memory or limits
17 Graphical Anomaly - Background SQL Sentry Customer – Financial ServicesBeta tester of SQL Sentry Performance Advisor for Analysis ServicesEager to test as they were suffering from SSAS performance issuesScheduled Microsoft to come on-site to help
24 The Investigation Continues Almost all time spent on non-cached Storage Engine operations (SE non-cached)Every time query needs data it’s not found in the FE CacheFE requests from SESE unable to find in its cacheMust go to file system
26 Caught Red Handed!Total Queries shows how many times storage engine went to the file system to read data from a partition or aggregation.Want this to be as close to 0 as possible.Exceptions are when Agg is first hit and loaded into cache or cache is cold.
30 Memory PreallocationIntroduced with SQL 2005 SP2 due to limitations with memory allocations in Windows Server 2003Edit in msmdsrv.ini<PreAllocate> </PreAllocate>Preallocates % of physical memory on SSAS startup
31 SQL CAT Tech NotesRunning Microsoft SQL Server 2008 Analysis Services on Windows Server 2008 vs. Windows Server 2003 and Memory Preallocation: Lessons LearnedAuthor: Carl Rabeler Contributors: Eric Jacobsen, Thomas Kejser Technical Reviewers: Brad Daniels, Lindsey Allen, John Desch, Wayne Robertson, Kevin Cox
32 SQL CAT Report SummarySSAS 2008 runs equally well on Windows 2008 with or without preallocationSSAS 2008 runs substantially better on Windows 2003 WITH preallocationEssentially equal to Windows 2008
33 Points to ConsiderBe sure to set low enough so sufficient memory remains for other processes and avoid paging.Be sure to set high enough for it to help SSASUse peak value for memory counters as guidelineAlso applies to SSAS 2005 (no change in code)
35 PreAllocate Pitfall? PreAllocate does not “override” memory limits Memory cleaner acts as if all preallocated memory is in use.In this case PreAllocate = TotalMemoryLimitResult – cleaner goes into crisis modePerformance suffers drastically