%3CLINGO-SUB%20id%3D%22lingo-sub-1106271%22%20slang%3D%22en-US%22%3EScaling%20up%20an%20IoT%20workload%20using%20an%20M-series%20Azure%20SQL%20database%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1106271%22%20slang%3D%22en-US%22%3E%3CH2%20id%3D%22toc-hId--1416284753%22%20id%3D%22toc-hId--1416284753%22%3EExecutive%20summary%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3EM-series%20provides%20close%20to%2030%20GB%20of%20memory%20per%20core%20and%20up%20to%20128%20cores%2C%20enabling%20significant%20scale-up%20capability%20in%20Azure%20SQL%20Database.%3C%2FLI%3E%0A%3CLI%3EFor%20the%20same%20IoT%20workload%2C%20we%20achieved%203%20times%20higher%20throughput%20on%20M-series%20compared%20to%20P15%2C%20at%20sustained%204.2%20million%20rows%20per%20second%20ingested%20on%20average.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22toc-hId-1071228080%22%20id%3D%22toc-hId-1071228080%22%3ENew%20hardware%20options%20in%20Azure%20SQL%20Database%3C%2FH2%3E%0A%3CP%3EAt%20the%20Ignite%20conference%20in%20November%202019%2C%20we%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-sql-database%2Fnew-memory-and-compute-optimized-hardware-options-in-azure-sql%2Fba-p%2F966830%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Eintroduced%3C%2FA%3E%20the%20preview%20of%20two%20new%20hardware%20options%20in%20Azure%20SQL%20Database%2C%20in%20addition%20to%20the%20current%20widely%20adopted%20Gen4%20and%20Gen5%20hardware.%20It%20is%20now%20possible%20to%20run%20SQL%20Server%20workloads%20on%20Azure%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fsizes-memory%23m-series%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EM-series%3C%2FA%3E%20and%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fsizes-compute%23fsv2-series-1%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EFsv2-series%3C%2FA%3E%20virtual%20machines%20within%20the%20Azure%20SQL%20Database%20PaaS%20service.%20This%20blog%20will%20closely%20examine%20the%20M-series%20database%20SKU%2C%20and%20present%20a%20scenario%20showcasing%20this%20new%20hardware%20option.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUsing%20M-series%20VMs%20in%20Azure%20SQL%20Database%20addresses%20a%20long-standing%20customer%20request%20to%20provide%20a%20database%20SKU%20with%20high%20memory%2Fcore%20ratio%2C%20while%20continuing%20to%20offer%20low%20latency%20and%20high%20throughput%20local%20SSD%20storage%20and%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fblog%2Fmaximize-your-vm-s-performance-with-accelerated-networking-now-generally-available-for-both-windows-and-linux%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAccelerated%20Networking%3C%2FA%3E%20capabilities%20of%20the%20Business%20Critical%20service%20tier.%20M-series%20has%20close%20to%2030%20GB%20of%20memory%20per%20core%2C%20compared%20to%207%20GB%2Fcore%20for%20Gen4%20and%205.1%20GB%2Fcore%20for%20Gen5.%20Further%2C%20with%20its%20128%20maximum%20cores%2C%20M-series%20provides%20the%20highest%20number%20of%20cores%20among%20all%20Azure%20SQL%20Database%20SKUs%2C%20compared%20to%20the%20previous%20maximum%20of%2080%20cores%20on%20Gen5.%20With%20these%20specifications%2C%20M-series%20databases%20are%20very%20well%20suited%20for%20the%20most%20demanding%20Azure%20SQL%20Database%20and%20SQL%20Server%20workloads%20that%20require%20vertical%20scalability%2C%20or%20a%20scale-up%20rather%20than%20a%20scale-out%20approach.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--736226383%22%20id%3D%22toc-hId--736226383%22%3EIoT%20data%20ingestion%20workload%3C%2FH2%3E%0A%3CP%3ETo%20put%20this%20claim%20to%20test%2C%20we%20ran%20one%20such%20workload%20on%20an%20M-series%20database.%20Back%20in%202017%2C%20we%20published%20a%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-sql-database%2Fazure-sql-database-ingesting-1-4-million-sustained-rows-per%2Fba-p%2F386162%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Eblog%20post%3C%2FA%3E%20describing%20a%20typical%20IoT%20workload%2C%20where%20data%20is%20ingested%20into%20a%20database%20from%20millions%20of%20simulated%20electrical%20power%20grid%20meters.%20The%20results%20described%20were%20remarkable%3A%20the%20workload%20achieved%20sustained%20ingestion%20of%201.4%20million%20rows%20per%20second.%20This%20high%20level%20of%20throughput%20was%20made%20possible%20by%20two%20state-of-the-art%20technologies%20in%20SQL%20Server.%20One%20is%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Frelational-databases%2Fin-memory-oltp%2Fin-memory-oltp-in-memory-optimization%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EIn-Memory%20OLTP%3C%2FA%3E%2C%20used%20to%20ingest%20data%20in%20memory%20at%20high%20concurrency%20and%20without%20lock%20and%20latch%20contention%2C%20following%20the%20%3CA%20href%3D%22https%3A%2F%2Fcloudblogs.microsoft.com%2Fsqlserver%2F2013%2F09%2F19%2Fin-memory-oltp-common-design-pattern-high-data-input-rateshock-absorber%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eshock%20absorber%3C%2FA%3E%20pattern.%20The%20other%20is%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Frelational-databases%2Findexes%2Fcolumnstore-indexes-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ecolumnstore%20indexes%3C%2FA%3E%2C%20used%20to%20offload%20and%20compress%20data%20from%20memory%20to%20disk%20for%20durability%20and%20efficient%20querying%20in%20analytical%20applications%2C%20and%20to%20free%20up%20memory%20for%20new%20data.%20In%20terms%20of%20hardware%20resources%2C%20achieving%20this%20level%20of%20throughput%20required%20a%20P15%20database%2C%20the%20largest%20SKU%20Azure%20SQL%20Database%20had%20at%20the%20time.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20remarkable%20as%20that%20result%20was%2C%20there%20were%20certain%20resource%20limits%20at%20the%20database%20level%20that%20did%20not%20allow%20the%20workload%20to%20scale%20beyond%201.4%20million%20rows%20per%20second.%20One%20was%20the%20memory%20quota%20allocated%20for%20memory-optimized%20tables.%20On%20a%20P15%20database%2C%20this%20quota%20is%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-dtu-resource-limits-single-databases%23premium-service-tier%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eset%3C%2FA%3E%20to%2032%20GB.%20This%20limited%20the%20ability%20of%20the%20database%20to%20handle%20spikes%20in%20data%20generation%20rate%2C%20or%20potential%20delays%20in%20data%20offloading%3A%20if%20the%20memory%20quota%20were%20exhausted%2C%20the%20workload%20would%20fail%20with%20out-of-memory%20errors.%20Another%20limit%20was%20on%20transaction%20log%20generation%20rate%3A%20as%20the%20original%20blog%20mentions%2C%20log%20rate%20frequently%20reached%20100%25%20of%20the%2042%20MB%2Fs%20limit%20of%20a%20P15%20database.%20Because%20of%20these%20limits%2C%20the%20database%20couldn%E2%80%99t%20offload%20data%20to%20columnstore%20indexes%20on%20disk%20any%20faster%2C%20and%20couldn%E2%80%99t%20sustain%20a%20higher%20ingestion%20rate%20without%20running%20out%20of%20available%20memory.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1751286450%22%20id%3D%22toc-hId-1751286450%22%3ERunning%20on%20M-series%3C%2FH2%3E%0A%3CP%3EHow%20does%20this%20workload%20fare%20on%20an%20M-series%20database%2C%20with%20its%20quota%20for%20memory-optimized%20tables%20at%201768%20GB%20(55x%20higher%20than%20on%20P15%2C%20with%2020x%20higher%20memory%2Fcore%20ratio)%2C%20and%20its%20log%20throughput%20rate%20at%20264%20MB%2Fs%20(6.3x%20higher%20than%20on%20P15)%3F%20To%20find%20out%2C%20we%20ran%20multiple%20instances%20of%20the%20same%20workload%20generator%20application%20concurrently%2C%20loading%20data%20into%20a%20common%20M-series%20database.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20goal%20of%20this%20test%20was%20to%20find%20out%20the%20extent%20of%20vertical%20scalability%20improvement%20achieved%20simply%20by%20using%20more%20capable%20hardware.%20For%20that%20reason%2C%20we%20have%20not%20modified%20workload%20parameters%20in%20any%20way%2C%20letting%20each%20copy%20of%20the%20workload%20generator%20produce%20the%20same%201.4%20million%20rows%20per%20second.%20We%20measured%20data%20ingestion%20rate%20by%20polling%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Frelational-databases%2Fsystem-dynamic-management-views%2Fsys-dm-db-xtp-object-stats-transact-sql%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Esys.dm_db_xtp_object_stats%3C%2FA%3E%20DMV%20in%20the%20database%20at%20five%20second%20intervals.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20configuration%2C%20we%20achieved%20%3CSTRONG%3E3%20times%3C%2FSTRONG%3E%20higher%20throughput%20on%20M-series%20compared%20to%20P15%2C%20at%20sustained%20%3CSTRONG%3E4.2%20million%20rows%20per%20second%3C%2FSTRONG%3E%20on%20average.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F165127i447FFE61D1E36AC8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22ingestion-4.2.png%22%20title%3D%22ingestion-4.2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20screenshot%20below%20shows%20three%20workload%20generator%20windows%20stacked%20vertically%2C%20each%20generating%20~1.4%20million%20rows%20per%20second%2C%20for%20the%20total%20of%204.2%20million%20rows%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20700px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F165128i44293676E84566B7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22iot-smart-city-m-series3.png%22%20title%3D%22iot-smart-city-m-series3.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhat%20is%20notable%20is%20that%20none%20of%20the%20resource%20limits%20of%20the%20M-series%20database%20is%20approached%20during%20this%20test%2C%20leaving%20ample%20headroom%20for%20other%20concurrent%20workloads%20against%20the%20database%20that%20would%20likely%20be%20present%20in%20a%20real%20customer%20scenario%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F165129i5141589DBA39862A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22iot-smart-city-m-series-resources4.png%22%20title%3D%22iot-smart-city-m-series-resources4.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECPU%20utilization%20is%20between%2060%25%20and%2070%25%20on%20average%2C%20average%20log%20generation%20rate%20is%20close%20to%2020%25%2C%20and%20memory%20utilization%20for%20memory-optimized%20tables%20is%20below%203%25%20of%20the%20quota.%20The%20latter%20point%20is%20important%2C%20because%20it%20shows%20that%20the%20database%20has%20enough%20resources%20to%20absorb%20large%20spikes%20in%20data%20generation%20rate%20without%20running%20out%20of%20memory.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20more%20detailed%20view%20of%20database%20performance%20for%20the%20same%20period%20can%20be%20seen%20on%20a%20%3CA%20href%3D%22https%3A%2F%2Fgrafana.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGrafana%3C%2FA%3E%20dashboard%20provided%20by%20a%20monitoring%20solution%20built%20on%20an%20open%20source%20monitoring%20stack%2C%20described%20in%20our%20earlier%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-sql-database%2Fmonitoring-azure-sql-database-with-telegraf%2Fba-p%2F882790%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Eblog%20post%3C%2FA%3E%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20868px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F165130i4A9EAE21E139C7B2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22iot-smart-city-m-series-resources-grafana-1.png%22%20title%3D%22iot-smart-city-m-series-resources-grafana-1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1853119372%22%20id%3D%22toc-hId--1853119372%22%3ESustaining%20spikes%20in%20data%20generation%20rate%3C%2FH3%3E%0A%3CP%3EFor%20how%20long%20can%20an%20M-series%20database%20sustain%20increased%20data%20generation%20rate%20before%20running%20out%20of%20memory%3F%20To%20find%20out%2C%20we%20disabled%20data%20offloading%20to%20disk%2C%20to%20have%20all%20new%20data%20accumulate%20in%20the%20schema-only%20memory-optimized%20table.%20Then%2C%20we%20configured%20the%20workload%20generator%20application%20to%20produce%20as%20much%20data%20per%20second%20as%20it%20could.%20With%20just%20one%20copy%20of%20workload%20generator%20running%2C%20we%20achieved%20data%20ingestion%20rate%20of%20%3CSTRONG%3Eover%205.1%20million%20rows%20per%20second%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F165131i625065189A706832%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22ingestion-5.png%22%20title%3D%22ingestion-5.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F165132iC7E3FBC58D3B45D4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22iot-smart-city-m-series4.png%22%20title%3D%22iot-smart-city-m-series4.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EObviously%2C%20since%20data%20offloading%20is%20not%20running%2C%20this%20rate%20cannot%20be%20sustained%20indefinitely.%20At%20this%20data%20ingestion%20rate%2C%20a%20P15%20database%20runs%20out%20of%20memory%20in%20about%20a%20minute.%20However%2C%20with%20its%2055x%20larger%20quota%20for%20memory-optimized%20tables%2C%20an%20M-series%20database%20%3CSTRONG%3E%3CEM%3Ecan%20sustain%20this%20rate%20for%20an%20hour%20and%20longer%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20also%20making%20the%20system%20much%20more%20resilient%20to%20any%20slowdowns%20in%20data%20offloading.%3C%2FP%3E%0A%3CP%3EThe%20Grafana%20dashboard%20below%20shows%20database%20resource%20usage%20during%20this%20simulated%20spike%20in%20data%20generation%2C%20showing%20memory%20consumption%20by%20the%20In-Memory%20OLTP%20clerk%20growing%20to%201.3%20TB%2C%20which%20is%20about%2075%25%20of%20the%20memory%20quota%20for%20memory-optimized%20tables.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20863px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F165134i82D8FFE7598F737B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22iot-smart-city-m-series-resources-grafana-2.png%22%20title%3D%22iot-smart-city-m-series-resources-grafana-2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-634393461%22%20id%3D%22toc-hId-634393461%22%3EColumnstore%20auto-merge%3C%2FH3%3E%0A%3CP%3ESince%20this%20IoT%20workload%20uses%20columnstore%20indexes%20for%20all%20persisted%20data%2C%20it%20is%20worthwhile%20mentioning%20a%20recent%20columnstore%20improvement.%20Customers%20who%20have%20been%20using%20columnstore%20indexes%20extensively%20know%20that%20to%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-data-warehouse%2Fsql-data-warehouse-memory-optimizations-for-columnstore-compression%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eachieve%20optimal%20query%20performance%3C%2FA%3E%3CSPAN%3E%20and%20compression%3C%2FSPAN%3E%20using%20columnstore%20indexes%2C%20the%20size%20of%20each%20rowgroup%20should%20be%20as%20close%20as%20possible%20to%20the%20maximum%20and%20optimal%20size%20of%201%2C048%2C576%20rows.%20When%20loading%20data%20into%20a%20columnstore%20index%2C%20batch%20size%20should%20ideally%20be%20set%20to%20this%20value%2C%20and%20should%20be%20at%20least%20102%2C400%20rows%20to%20load%20data%20directly%20into%20compressed%20rowgroups.%20For%20details%2C%20see%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Frelational-databases%2Findexes%2Fcolumnstore-indexes-data-loading-guidance%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EColumnstore%20indexes%20-%20Data%20loading%20guidance%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20the%20workload%20generator%20application%20runs%20a%20data%20offloading%20task%20to%20move%20data%20from%20the%20memory-optimized%20table%20to%20the%20clustered%20columnstore%20table%2C%20it%20picks%20a%20subset%20of%20data%20generated%20by%20an%20individual%20power%20grid%20meter.%20Occasionally%2C%20it%20can%20happen%20that%20the%20remaining%20number%20of%20rows%20for%20a%20given%20meter%20in%20the%20memory-optimized%20table%20is%20less%20than%20the%20size%20of%20the%20offloading%20batch.%20At%20the%20end%20of%20the%20test%20run%2C%20this%20results%20in%20a%20few%20hundred%20rowgroups%20being%20relatively%20small%2C%20around%20100K%20rows%20in%20size%20each.%20This%20pattern%20is%20not%20uncommon%20in%20many%20data%20loading%20scenarios.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20way%20to%20increase%20rowgroup%20size%20and%20improve%20columnstore%20quality%20is%20to%20reorganize%20the%20columnstore%20index%2C%20as%20described%20in%20detail%20in%20an%20earlier%20SQLCAT%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fdatacat%2Fsql-2016-columnstore-row-group-merge-policy-and-index%2Fba-p%2F305255%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Eblog%3C%2FA%3E.%20This%20merges%20multiple%20smaller%20rowgroups%20into%20fewer%20larger%20rowgroups%2C%20sized%20up%20to%201%2C048%2C576%20rows.%20However%2C%20reorganizing%20an%20index%20is%20a%20resource-intensive%20operation%20that%20a%20customer%20must%20implement%20on%20their%20own.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20Azure%20SQL%20Database%2C%20the%20need%20for%20this%20specific%20type%20of%20columnstore%20index%20maintenance%20is%20much%20reduced%2C%20and%20in%20many%20cases%20eliminated%20altogether.%20As%20part%20of%20several%20recent%20improvements%20in%20columnstore%20indexes%2C%20the%20background%20tuple%20mover%20thread%20now%20automatically%20merges%20smaller%20compressed%20rowgroups%20into%20larger%20compressed%20rowgroups.%20To%20observe%20the%20results%2C%20we%20ran%20the%20following%20query%20a%20few%20hours%20after%20the%20load%20had%20stopped%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3ESELECT%20state_desc%2C%0A%20%20%20%20%20%20%20trim_reason_desc%2C%0A%20%20%20%20%20%20%20transition_to_compressed_state_desc%2C%0A%20%20%20%20%20%20%20AVG(size_in_bytes)%20AS%20avg_size_in_bytes%2C%0A%20%20%20%20%20%20%20AVG(total_rows)%20AS%20avg_total_rows%2C%0A%20%20%20%20%20%20%20SUM(total_rows)%20AS%20total_rows%2C%0A%20%20%20%20%20%20%20COUNT(1)%20AS%20rowgroup_count%0AFROM%20sys.dm_db_column_store_row_group_physical_stats%0AGROUP%20BY%20state_desc%2C%0A%20%20%20%20%20%20%20%20%20trim_reason_desc%2C%0A%20%20%20%20%20%20%20%20%20transition_to_compressed_state_desc%0AORDER%20BY%20state_desc%2C%0A%20%20%20%20%20%20%20%20%20trim_reason_desc%2C%0A%20%20%20%20%20%20%20%20%20transition_to_compressed_state_desc%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20result%20shows%20that%20hundreds%20of%20smaller%20rowgroups%20have%20been%20auto-merged%20into%20twenty%20five%20rowgroups%2C%20each%20sized%20close%20to%20one%20million%20rows%20each%20to%20provide%20optimal%20compression%20and%20query%20performance%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F165135iF13344F01A7AA996%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22auto-merge-5.png%22%20title%3D%22auto-merge-5.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-623890357%22%20id%3D%22toc-hId-623890357%22%3EConclusion%3C%2FH2%3E%0A%3CP%3EThe%20Azure%20SQL%20Database%20service%20is%20continuously%20improved%20to%20support%20a%20wider%20variety%20of%20SQL%20Server%20workloads%20in%20Azure.%20The%20recent%20addition%20of%20M-series%20as%20a%20hardware%20option%20unlocks%20unprecedented%20vertical%20scalability%20in%20the%20service.%20For%20a%20closer%20look%20at%20M-series%20resource%20limits%20during%20preview%2C%20see%20documentation%20for%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-vcore-resource-limits-single-databases%23business-critical---provisioned-compute---m-series%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Esingle%20databases%3C%2FA%3E%20and%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-vcore-resource-limits-elastic-pools%23business-critical---provisioned-compute---m-series%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eelastic%20pools%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EM-series%20has%20already%20allowed%20very%20demanding%20CRM%20and%20eCommerce%20workloads%20migrate%20to%20Azure%20SQL%20Database%20and%20enjoy%20the%20benefits%20of%20a%20PaaS%20service.%20While%20the%20current%20preview%20only%20supports%20the%20largest%20M-series%20SKU%20with%20128%20cores%2C%20smaller%20SKUs%20for%20both%20single%20databases%20and%20elastic%20pools%20are%20on%20the%20roadmap.%20Once%20available%2C%20they%20will%20let%20a%20much%20broader%20range%20of%20customers%20choose%20the%20right%20sized%20SKU%20on%20M-series%20for%20their%20workloads%2C%20and%20reap%20the%20benefits%20of%20scalability%20improvements%20provided%20by%20the%20high%20memory%2Fcore%20ratio%20of%20this%20hardware.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1106271%22%20slang%3D%22en-US%22%3E%3CUL%3E%0A%3CLI%3EM-series%20provides%20close%20to%2030%20GB%20of%20memory%20per%20core%20and%20up%20to%20128%20cores%2C%20enabling%20significant%20scale-up%20capability%20in%20Azure%20SQL%20Database.%3C%2FLI%3E%0A%3CLI%3EFor%20the%20same%20IoT%20workload%2C%20we%20achieved%203%20times%20higher%20throughput%20on%20M-series%20compared%20to%20P15%2C%20at%20sustained%204.2%20million%20rows%20per%20second%20ingested%20on%20average.%3C%2FLI%3E%0A%3C%2FUL%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1106271%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EInternals%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMonitoring%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPerformance%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Executive summary

  • M-series provides close to 30 GB of memory per core and up to 128 cores, enabling significant scale-up capability in Azure SQL Database.
  • For the same IoT workload, we achieved 3 times higher throughput on M-series compared to P15, at sustained 4.2 million rows per second ingested on average.

New hardware options in Azure SQL Database

At the Ignite conference in November 2019, we introduced the preview of two new hardware options in Azure SQL Database, in addition to the current widely adopted Gen4 and Gen5 hardware. It is now possible to run SQL Server workloads on Azure M-series and Fsv2-series virtual machines within the Azure SQL Database PaaS service. This blog will closely examine the M-series database SKU, and present a scenario showcasing this new hardware option.

 

Using M-series VMs in Azure SQL Database addresses a long-standing customer request to provide a database SKU with high memory/core ratio, while continuing to offer low latency and high throughput local SSD storage and Accelerated Networking capabilities of the Business Critical service tier. M-series has close to 30 GB of memory per core, compared to 7 GB/core for Gen4 and 5.1 GB/core for Gen5. Further, with its 128 maximum cores, M-series provides the highest number of cores among all Azure SQL Database SKUs, compared to the previous maximum of 80 cores on Gen5. With these specifications, M-series databases are very well suited for the most demanding Azure SQL Database and SQL Server workloads that require vertical scalability, or a scale-up rather than a scale-out approach.

 

IoT data ingestion workload

To put this claim to test, we ran one such workload on an M-series database. Back in 2017, we published a blog post describing a typical IoT workload, where data is ingested into a database from millions of simulated electrical power grid meters. The results described were remarkable: the workload achieved sustained ingestion of 1.4 million rows per second. This high level of throughput was made possible by two state-of-the-art technologies in SQL Server. One is In-Memory OLTP, used to ingest data in memory at high concurrency and without lock and latch contention, following the shock absorber pattern. The other is columnstore indexes, used to offload and compress data from memory to disk for durability and efficient querying in analytical applications, and to free up memory for new data. In terms of hardware resources, achieving this level of throughput required a P15 database, the largest SKU Azure SQL Database had at the time.

 

As remarkable as that result was, there were certain resource limits at the database level that did not allow the workload to scale beyond 1.4 million rows per second. One was the memory quota allocated for memory-optimized tables. On a P15 database, this quota is set to 32 GB. This limited the ability of the database to handle spikes in data generation rate, or potential delays in data offloading: if the memory quota were exhausted, the workload would fail with out-of-memory errors. Another limit was on transaction log generation rate: as the original blog mentions, log rate frequently reached 100% of the 42 MB/s limit of a P15 database. Because of these limits, the database couldn’t offload data to columnstore indexes on disk any faster, and couldn’t sustain a higher ingestion rate without running out of available memory.

 

Running on M-series

How does this workload fare on an M-series database, with its quota for memory-optimized tables at 1768 GB (55x higher than on P15, with 20x higher memory/core ratio), and its log throughput rate at 264 MB/s (6.3x higher than on P15)? To find out, we ran multiple instances of the same workload generator application concurrently, loading data into a common M-series database.

 

The goal of this test was to find out the extent of vertical scalability improvement achieved simply by using more capable hardware. For that reason, we have not modified workload parameters in any way, letting each copy of the workload generator produce the same 1.4 million rows per second. We measured data ingestion rate by polling the sys.dm_db_xtp_object_stats DMV in the database at five second intervals.

 

In this configuration, we achieved 3 times higher throughput on M-series compared to P15, at sustained 4.2 million rows per second on average.

 

ingestion-4.2.png

 

The screenshot below shows three workload generator windows stacked vertically, each generating ~1.4 million rows per second, for the total of 4.2 million rows:

 

iot-smart-city-m-series3.png

 

What is notable is that none of the resource limits of the M-series database is approached during this test, leaving ample headroom for other concurrent workloads against the database that would likely be present in a real customer scenario:

 

iot-smart-city-m-series-resources4.png

 

CPU utilization is between 60% and 70% on average, average log generation rate is close to 20%, and memory utilization for memory-optimized tables is below 3% of the quota. The latter point is important, because it shows that the database has enough resources to absorb large spikes in data generation rate without running out of memory.

 

A more detailed view of database performance for the same period can be seen on a Grafana dashboard provided by a monitoring solution built on an open source monitoring stack, described in our earlier blog post:

 

iot-smart-city-m-series-resources-grafana-1.png

 

Sustaining spikes in data generation rate

For how long can an M-series database sustain increased data generation rate before running out of memory? To find out, we disabled data offloading to disk, to have all new data accumulate in the schema-only memory-optimized table. Then, we configured the workload generator application to produce as much data per second as it could. With just one copy of workload generator running, we achieved data ingestion rate of over 5.1 million rows per second.

 

ingestion-5.png

 

 

iot-smart-city-m-series4.png

 

Obviously, since data offloading is not running, this rate cannot be sustained indefinitely. At this data ingestion rate, a P15 database runs out of memory in about a minute. However, with its 55x larger quota for memory-optimized tables, an M-series database can sustain this rate for an hour and longer, also making the system much more resilient to any slowdowns in data offloading.

The Grafana dashboard below shows database resource usage during this simulated spike in data generation, showing memory consumption by the In-Memory OLTP clerk growing to 1.3 TB, which is about 75% of the memory quota for memory-optimized tables.

 

iot-smart-city-m-series-resources-grafana-2.png

 

Columnstore auto-merge

Since this IoT workload uses columnstore indexes for all persisted data, it is worthwhile mentioning a recent columnstore improvement. Customers who have been using columnstore indexes extensively know that to achieve optimal query performance and compression using columnstore indexes, the size of each rowgroup should be as close as possible to the maximum and optimal size of 1,048,576 rows. When loading data into a columnstore index, batch size should ideally be set to this value, and should be at least 102,400 rows to load data directly into compressed rowgroups. For details, see Columnstore indexes - Data loading guidance.

 

When the workload generator application runs a data offloading task to move data from the memory-optimized table to the clustered columnstore table, it picks a subset of data generated by an individual power grid meter. Occasionally, it can happen that the remaining number of rows for a given meter in the memory-optimized table is less than the size of the offloading batch. At the end of the test run, this results in a few hundred rowgroups being relatively small, around 100K rows in size each. This pattern is not uncommon in many data loading scenarios.

 

The way to increase rowgroup size and improve columnstore quality is to reorganize the columnstore index, as described in detail in an earlier SQLCAT blog. This merges multiple smaller rowgroups into fewer larger rowgroups, sized up to 1,048,576 rows. However, reorganizing an index is a resource-intensive operation that a customer must implement on their own.

 

In Azure SQL Database, the need for this specific type of columnstore index maintenance is much reduced, and in many cases eliminated altogether. As part of several recent improvements in columnstore indexes, the background tuple mover thread now automatically merges smaller compressed rowgroups into larger compressed rowgroups. To observe the results, we ran the following query a few hours after the load had stopped:

 

SELECT state_desc,
       trim_reason_desc,
       transition_to_compressed_state_desc,
       AVG(size_in_bytes) AS avg_size_in_bytes,
       AVG(total_rows) AS avg_total_rows,
       SUM(total_rows) AS total_rows,
       COUNT(1) AS rowgroup_count
FROM sys.dm_db_column_store_row_group_physical_stats
GROUP BY state_desc,
         trim_reason_desc,
         transition_to_compressed_state_desc
ORDER BY state_desc,
         trim_reason_desc,
         transition_to_compressed_state_desc;

 

 

The result shows that hundreds of smaller rowgroups have been auto-merged into twenty five rowgroups, each sized close to one million rows each to provide optimal compression and query performance:

 

auto-merge-5.png

 

Conclusion

The Azure SQL Database service is continuously improved to support a wider variety of SQL Server workloads in Azure. The recent addition of M-series as a hardware option unlocks unprecedented vertical scalability in the service. For a closer look at M-series resource limits during preview, see documentation for single databases and elastic pools.

 

M-series has already allowed very demanding CRM and eCommerce workloads migrate to Azure SQL Database and enjoy the benefits of a PaaS service. While the current preview only supports the largest M-series SKU with 128 cores, smaller SKUs for both single databases and elastic pools are on the roadmap. Once available, they will let a much broader range of customers choose the right sized SKU on M-series for their workloads, and reap the benefits of scalability improvements provided by the high memory/core ratio of this hardware.