Home
%3CLINGO-SUB%20id%3D%22lingo-sub-916794%22%20slang%3D%22en-US%22%3EOptimize%20OLTP%20Performance%20with%20SQL%20Server%20on%20Azure%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-916794%22%20slang%3D%22en-US%22%3E%3CP%3E%3CEM%3EWritten%20by%20Mine%20Tokus%2C%20Senior%20Program%20Manager%3B%20Jamie%20Reding%2C%20Senior%20Program%20Manager%20and%20Sadashivan%20Krishnamurthy%2C%20Principal%20Architect%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3EReviewed%20by%20Bob%20Ward%2C%20Principal%20Architect%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMost%20of%20you%20are%20running%20OLTP%20applications%20today%20with%20read%20heavy%20and%20complex%20transactions.%20The%20%3CSPAN%3E%3CA%20href%3D%22http%3A%2F%2Fwww.tpc.org%2Ftpce%2Fdefault.asp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ETPC-E%3C%2FA%3E%3C%2FSPAN%3E%20benchmark%20is%20a%20reliable%20representation%20of%20modern%20OLTP%20workloads%20and%20highly%20recommended%20to%20measure%20OLTP%20workload%20performance.%20The%20TPC-E%20benchmark%20uses%20diverse%20transactions%20and%20utilizes%20wide%20range%20of%20data%20types%20with%2012%20transactions%20acting%20on%2033%20tables%20all%20exercising%20the%20ACID%20compliance%20tests.%26nbsp%3BThese%20transactions%20cover%20traditional%20OLTP%20processing%20along%20with%20some%20very%20light%20analytic%20queries.%20In%20this%20article%2C%20we%20will%20share%20recommendations%20to%20optimize%20SQL%20Server%20performance%20on%20Azure%20VMs%20based%20on%20performance%20testing%20with%20scaled%20down%20TPC-E%20%5B1%5D%20benchmark.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fsizes-memory%23esv3-series%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Es_v3%20series%3C%2FA%3E%3C%2FSPAN%3E%20offer%20price%2Fperf%20advantages%20with%20the%20optimized%20memory%20to%20v-core%20ratios%20and%20commonly%20selected%20by%20SQL%20Server%20customers.%20We%20used%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fsizes-memory%23esv3-series%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EE64s_v3%20VM%3C%2FA%3E%3C%2FSPAN%3E%20size%20as%20the%20server%20for%20this%20tests%20which%20comes%20with%2064%20hyper%20threaded%20v-cores%20on%202.3%20GHz%20Intel%20XEON%20%C2%AE%20E5-2673%20v4%20(Broadwell)%20processor%20family%2C%20432%20GB%20memory%20and%201600%20GB%20of%20Azure%20Blob%20Cache%20capacity.%26nbsp%3B%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20%23ffffff%3B%20color%3A%20%23333333%3B%20cursor%3A%20text%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3EOn%20the%20client%20side%2C%26nbsp%3Bwe%20placed%20the%20client%20in%20the%20same%20region%20and%20availability%20zone%20as%20the%20server.%26nbsp%3B%20We%20used%20DS13-v2%E2%80%99s%20for%20all%20clients%20and%20%3CSPAN%20style%3D%22background-color%3A%20%23ffffff%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20cursor%3A%20text%3B%20display%3A%20inline%3B%20float%3A%20none%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3Escaled%20down%20TPC-E%20workload%20to%20800%2C000%20customers%20with%20data%20size%20at%20800GB%3C%2FSPAN%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1846924700%22%20id%3D%22toc-hId-1846924700%22%3EAzure%20Blob%20Cache%20is%20the%20key%20for%20the%20best%20price%2Fperf%3C%2FH2%3E%0A%3CP%3EFor%20the%20first%20test%20we%20used%202%20of%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fdisks-types%23premium-ssd%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPremium%20SSD%3C%2FA%3E%3C%2FSPAN%3E%20P30%20disks%20for%20SQL%20Server%20data%20file%20and%201%20Premium%20SSD%20P20%20disk%20for%20SQL%20Server%20log%20file.%20We%20enabled%20%3CSPAN%3E%3CEM%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fpremium-storage-performance%23disk-caching%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EReadOnly%20cache%3C%2FA%3E%3C%2FEM%3E%3C%2FSPAN%3E%20for%20both%20P30%20disks%20and%20created%20a%20drive%20with%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fpremium-storage-performance%23disk-striping%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Edisk%20striping%3C%2FA%3E%3C%2FSPAN%3E%20for%20SQL%20Server%20data%20file.%20Data%20drive%20had%2010%2C000%20IOPS%20and%20400MB%2Fsec%20throughput%20capacity%20with%202-P30%20disks%20and%20log%20drive%20had%202300%20IOPS%20and%20150%20MB%2Fsec%20throughput%20capacity%20with%201%20P20%20disk.%20We%20used%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fportal.azure.com%2F%23create%2FMicrosoft.SQLServer2017EnterpriseWindowsServer2016%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESQL%20Server%202017%20Enterprise%20Edition%20with%20Windows%20Server%202016%20Data%20Center%3C%2FA%3E%3C%2FSPAN%3E%20with%20SQL%20Server%20defaults%20except%20that%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Fdatabase-engine%2Fconfigure-windows%2Fenable-the-lock-pages-in-memory-option-windows%3Fview%3Dsql-server-2017%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ELock%20Pages%20in%20memory%3C%2FA%3E%3C%2FSPAN%3E%20is%20enabled%20and%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Fdatabase-engine%2Fconfigure-windows%2Fserver-memory-server-configuration-options%3Fview%3Dsql-server-2017%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Emax%20server%20memory%3C%2FA%3E%3C%2FSPAN%3E%20is%20set%20to%2090%25.%20Data%20and%20Log%20files%20are%20located%20on%20separate%20drives%20and%20Temp%20DB%20files%20are%20located%20on%20local%20SSD%20(D%3A%20drive).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20first%20test%2C%20workload%20drove%2018%2C403%20IO%20per%20second%20and%20reached%20up%20to%20490%20TPS%20(Transaction%20Per%20Second)%20with%20256%20concurrent%20users%20(%3CEM%3ETable-1%3C%2FEM%3E).%20That%20is%20a%20great%20price%2Fperformance%20optimization%20level%20as%20the%20paid%20IO%20capacity%20is%20used%20only%20for%20writes%20(9%2C668%20write%20IOPS%20served%20by%202-P30%20disks)%20and%20all%20reads%20(8%2C735%20total%20read%20IOPS)%20are%20served%20from%20the%20blob%20cache.%20%3CU%3EThis%20is%20a%20huge%20benefit%20for%20ready%20heavy%20workloads%20as%20all%20the%20read%20IOPS%20are%20served%20directly%20from%20the%20host%20cache%20with%20very%20low%20response%20times%20and%20did%20not%20occur%20any%20additional%20charges.%3C%2FU%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CEM%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137891iE31B71FBFB4F52A6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Table1.png%22%20title%3D%22Table1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3ETable%201-%20E64s_v3%2C%202-P30%20for%20data%20and%201%20P20%20for%20Log%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--705232261%22%20id%3D%22toc-hId--705232261%22%3EScale%20up%20application%20throughput%20by%20simply%20by%20adding%20more%20storage%20capacity%3C%2FH2%3E%0A%3CP%3EThe%20first%20test%20was%20bottlenecked%20on%20the%20writes%20as%202-%20P30%20disks%20are%20throttled%20at%2010%2C000%20IOPS.%20We%20repeated%20this%20test%20with%204%20P30%20disks%20stripped%20on%20a%20single%20drive%20(all%20disks%20have%20%3CEM%3EReadOnly%3C%2FEM%3E%20cache%20enabled)%20to%20host%20SQL%20Server%20data%20file%20and%201%20P20%20disk%20for%20SQL%20Server%20log%20file.%20The%20same%20workload%20scaled%20up%20to%20823%20TPS%20with%2067%25%20increase%20on%20the%20application%20throughput.%20Running%20823%20TPS%20(14%2C672%20batch%20requests%2Fsec)%20required%20total%2037K%20IO%20per%20second%20(%3CEM%3ETable%20-2%3C%2FEM%3E).%20Again%2C%204%20P30%20disks%20are%20used%20only%20for%20the%20writes%20(18%2C978%20writes%20IOPS)%20and%20all%20reads%20are%20served%20from%20the%20free%20blob%20cache%20(17%2C809%20read%20IOPS).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CU%3ETo%20scale%20up%20the%20workload%20and%20increase%20the%20throughput%20start%20with%20adding%20additional%20storage%20capacity%20until%20CPU%20becomes%20the%20bottleneck.%3C%2FU%3E%20With%20823%20TPS%20on%20E64s_v3%2C%20the%20CPU%20was%20only%20consumed%20at%2045%25%2C%20there%20is%20still%20significant%20bandwidth%20on%20this%20VM%20to%20increase%20throughput%20by%20simply%20increasing%20storage%20capacity.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_1%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CEM%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137892i0E1965C90382F72E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22table2.png%22%20title%3D%22table2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3ETable%202-%20E64s_v3%2C%204-P30%20for%20data%20and%201%20P20%20for%20Log%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1037578074%22%20id%3D%22toc-hId-1037578074%22%3EMaximize%20throughput%20with%20lower%20storage%20response%20times%3C%2FH2%3E%0A%3CP%3EPremium%20Disks%20has%20great%20price%2Fperformance%20advantages%20with%20%3CEM%3EReadOnly%3C%2FEM%3E%20caching%20and%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fpricing%2Fdetails%2Fmanaged-disks%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Emonthly%20low-end%20storage%20cost%3C%2FA%3E%3C%2FSPAN%3E.%20If%20your%20workload%20requires%20very%20low%20storage%20response%20times%2C%20then%20you%20can%20use%20ultra-disk%20to%20get%20microsecond%20level%20IO%20latencies%20at%20very%20high%20IOPS.%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fdisks-types%23ultra-disk%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20ultra-disks%3C%2FA%3E%3C%2FSPAN%3E%20deliver%20high%20throughput%2C%20high%20IOPS%2C%20and%20consistent%20low%20latency%20disk%20storage%20for%20Azure%20VMs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20the%20same%20test%20repeated%20with%20SQL%20server%20data%20and%20log%20files%20on%20Ultra%20Disk%2C%20we%20got%20up%20to%201%2C489%20TPS%20and%20utilized%20all%20VM%20resources%20at%20peak%20(the%20CPU%20is%20consumed%20at%2092%25).%20Single%20ultra-disk%20provided%2060%2C000%20total%20IOPS%20(31%2C431%20read%20IOPS%20and%2029%2C250%20write%20IOPS)%20and%20total%20964%20MB%2Fsec%20throughput%20with%20microsecond%20level%20response%20times%20(%3CEM%3ETable-3%3C%2FEM%3E).%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_2%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CEM%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137893i677DD70EAFB0636F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22table3.png%22%20title%3D%22table3.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3ETable%203-%20E64s_v3%2C%20Ultra%20Disk%20for%20Data%20and%20Log%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1514578887%22%20id%3D%22toc-hId--1514578887%22%3EPremium%20SSD%20delivers%20great%20performance%20for%20write%20heavy%20workloads%3C%2FH2%3E%0A%3CP%3EIf%20you%20are%20running%20a%20write%20heavy%20workload%20with%20simple%20transactions%2C%20then%20you%20can%20validate%20performance%20with%20the%20%3CSPAN%3E%3CA%20href%3D%22http%3A%2F%2Fwww.tpc.org%2Ftpcc%2Fdefault.asp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ETPC-C%3C%2FA%3E%3C%2FSPAN%3E%20benchmark.%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fwww.hammerdb.com%2Fabout.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EHammer%20DB%20TPC-C%3C%2FA%3E%20%3C%2FSPAN%3E%20%5B2%5D%20is%20a%20tool%20that%20can%20be%20used%20to%20simplify%20TPC-C%20benchmarking.%20We%20run%20Hammer%20DB%20TPC-C%20with%201000%20warehouses%20at%20100GB%20total%20size.%20Test%20server%20is%20configured%20with%20SQL%20Server%202017%20Enterprise%20edition%20on%20E64_v3%3B%20data%20files%20located%20on%20a%20storage%20pool%20stripped%20over%202-P30%20disks%20(%3CEM%3EReadOnly%3C%2FEM%3E%20cache%20enabled)%2C%20log%20file%20is%20located%20on%20a%20single%20P20%20disk%20and%20Temp%20DB%20files%20are%20hosted%20on%20Local%20disk.%20With%20this%20test%2C%20workload%20reached%20to%20936%2C896%20TPM%20(Transaction%20Per%20Minute)%20as%20total%20IOPS%20are%20throttled%20at%2010%2C000%20with%202-P30%20disks%20(%3CEM%3ETable%20-%204%3C%2FEM%3E).%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_3%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CEM%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137894i56A14E1059BD73A7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22table4.png%22%20title%3D%22table4.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3ETable%204%20%E2%80%93%20E64_v3%2C%202%20P30%20for%20Data%2C%201%20P20%20for%20Log%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENote%20that%2C%20on%20this%20run%20CPU%20utilization%20was%20only%20at%2012%25.%20Can%20we%20double%20the%20throughput%20by%20simply%20adding%20more%20storage%20capacity%3F%20The%20answer%20is%20yes%2C%20simply%20by%20adding%202%20more%20P30%20drives%2C%20workload%20reached%20to%201.6%20million%20TPM%20(%3CEM%3ETable%20-%205%3C%2FEM%3E).%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_4%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CEM%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137895iFDF269BDCA017BA1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22table5.png%22%20title%3D%22table5.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3ETable%205-%20E64s_v3%2C%204%20P30%20for%20Data%20and%201%20P20%20for%20log.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWrite%20heavy%20workloads%20modify%20data%20in%20memory%20at%20a%20frequent%20rate.%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Frelational-databases%2Flogs%2Fdatabase-checkpoints-sql-server%3Fview%3Dsql-server-2017%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECheckpoint%3C%2FA%3E%3C%2FSPAN%3E%20process%20writes%20the%20in-memory%20modified%20pages%20(known%20as%20%3CEM%3Edirty%20pages%3C%2FEM%3E)%20and%20transaction%20log%20information%20from%20memory%20to%20disk.%20For%20write%20heavy%20workloads%2C%20SQL%20Server%20performs%20intensive%20IO%20activity%20to%20achieve%20the%201-minute%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Frelational-databases%2Flogs%2Fchange-the-target-recovery-time-of-a-database-sql-server%3Fview%3Dsql-server-ver15%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Edefault%20recovery%20time%3C%2FA%3E%3C%2FSPAN%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20show%20the%20impact%20of%20the%20checkpoint%20process%20on%20throughput%2C%20we%20repeated%20the%20same%20test%20with%20recovery%20interval%20set%20to%20the%20maximum%20value%20(checkpoint%20processes%20is%20disabled).%20When%20recovery%20interval%20is%20set%20to%20maximum%2C%20the%20HammerDB%20TPC-C%20workload%20doubled%20the%20throughput%20and%20reached%20up%20to%203%2C2%20million%20TPM%20(%3CEM%3ETable%20-%206%3C%2FEM%3E).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137896i5A2CA3B755A1F117%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22table6.png%22%20title%3D%22table6.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEM%3ETable%206%20%E2%80%93%20E64s_v3%2C%20Data%20on%204-P30%2C%20Recovery%20Time%20is%20set%20to%20max.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20setting%20was%20experimental%20only%20and%20cannot%20be%20used%20on%20production%20environments.%20But%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Frelational-databases%2Flogs%2Fchange-the-target-recovery-time-of-a-database-sql-server%3Fview%3Dsql-server-2017%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Erecovery%20time%20interval%3C%2FA%3E%3C%2FSPAN%3E%20can%20be%20relaxed%20to%20increase%20the%20throughout%20for%20write%20heavy%20workloads%20modifying%20millions%20of%20pages%20per%20minute.%20If%20aiming%20for%20recovery%20in%20~5%20minutes%20or%20more%20is%20acceptable%20for%20the%20workload%2C%20then%20relaxing%20the%20recovery%20time%20interval%20setting%20will%20enable%20higher%20throughput%20at%20the%20same%20cost.%3C%2FP%3E%0A%3CP%3EWith%20a%20wide%20range%20of%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fsizes-memory%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EVM%20series%20and%20sizes%3C%2FA%3E%3C%2FSPAN%3E%2C%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fdisks-types%23premium-ssd%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPremium%20SSD%3C%2FA%3E%3C%2FSPAN%3E%20and%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fdisks-types%23ultra-disk%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EUltra%20Disks%3C%2FA%3E%3C%2FSPAN%3E%20Azure%20offers%20many%20option%20to%20design%20for%20your%20workloads%E2%80%99%20specific%20performance%20requirements.%20Leverage%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fsql%2Fvirtual-machines-windows-sql-performance%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ethe%20performance%20best%20practices%3C%2FA%3E%3C%2FSPAN%3E%20to%20boost%20throughput%20for%20your%20OLTP%20workload%20with%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Fsql%2Fvirtual-machines-windows-sql-server-iaas-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESQL%20Server%20workloads%20with%20Azure%20VMs%3C%2FA%3E%3C%2FSPAN%3E%3CSTRONG%3E.%20%3C%2FSTRONG%3EClick%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fportal.azure.com%2F%23create%2FMicrosoft.FreeSQLServerLicenseSQLServer2017DeveloperonWindowsServer2016%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E%3C%2FSPAN%3E%20to%20start%20testing%20with%20free%20SQL%20Server%20Developer%20edition%20images%20on%20Azure%20VMs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%5B1%5D%20Scaled%20down%20TPC-E%20model%20reduces%20the%20initial%20footprint%20of%20the%20database.%26nbsp%3B%20It%20is%20primarily%20used%20for%20ease%20of%20benchmarking%3B%20we%20reduced%20the%20amount%20of%20history%20rows%20and%20then%20instruct%20the%20driver%20to%20not%20search%20too%20far%20back.%26nbsp%3B%20For%20our%20tests%2C%20we%20reduced%20the%20number%20of%20trade%20days%20in%20the%26nbsp%3Bhistory%20table%20from%20300%20to%2030.%26nbsp%3BPlease%20note%20that%20results%20from%20the%20scaled%20down%20model%20are%20non-comparable%20to%20the%20published%20results.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%5B2%5D%20HammerDB%20provides%20an%20implementation%20of%20the%20TPC-C%20benchmark.%20HammerDB%20TPC-C%20is%20derived%20from%20TPC-C%20and%20as%20such%20is%20not%20comparable%20to%20published%20TPC-C%20results%2C%20and%20the%20HammerDB%20TPC-C%20results%20do%20not%20fully%20comply%20with%20TPC-C.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-916794%22%20slang%3D%22en-US%22%3E%3CP%3EMost%20of%20you%20are%20running%20OLTP%20applications%20today%20with%20read%20heavy%20and%20complex%20transactions.%20The%20%3CSPAN%3E%3CA%20href%3D%22http%3A%2F%2Fwww.tpc.org%2Ftpce%2Fdefault.asp%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ETPC-E%3C%2FA%3E%3C%2FSPAN%3E%20benchmark%20is%20a%20reliable%20representation%20of%20modern%20OLTP%20workloads%20and%20highly%20recommended%20to%20measure%20OLTP%20workload%20performance.%20The%20TPC-E%20benchmark%20uses%20diverse%20transactions%20and%20utilizes%20wide%20range%20of%20data%20types%20with%2012%20transactions%20acting%20on%2033%20tables%20all%20exercising%20the%20ACID%20compliance%20tests.%26nbsp%3BThese%20transactions%20cover%20traditional%20OLTP%20processing%20along%20with%20some%20very%20light%20analytic%20queries.%20In%20this%20article%2C%20we%20will%20share%20recommendations%20to%20optimize%20SQL%20Server%20performance%20on%20Azure%20VMs%20based%20on%20performance%20testing%20with%20scaled%20down%20TPC-E%20%5B1%5D%20benchmark.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-916794%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESQLServerAzureVM%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Written by Mine Tokus, Senior Program Manager; Jamie Reding, Senior Program Manager and Sadashivan Krishnamurthy, Principal Architect

 

Reviewed by Bob Ward, Principal Architect

 

Most of you are running OLTP applications today with read heavy and complex transactions. The TPC-E benchmark is a reliable representation of modern OLTP workloads and highly recommended to measure OLTP workload performance. The TPC-E benchmark uses diverse transactions and utilizes wide range of data types with 12 transactions acting on 33 tables all exercising the ACID compliance tests. These transactions cover traditional OLTP processing along with some very light analytic queries. In this article, we will share recommendations to optimize SQL Server performance on Azure VMs based on performance testing with scaled down TPC-E [1] benchmark.

 

Azure Es_v3 series offer price/perf advantages with the optimized memory to v-core ratios and commonly selected by SQL Server customers. We used E64s_v3 VM size as the server for this tests which comes with 64 hyper threaded v-cores on 2.3 GHz Intel XEON ® E5-2673 v4 (Broadwell) processor family, 432 GB memory and 1600 GB of Azure Blob Cache capacity. On the client side, we placed the client in the same region and availability zone as the server.  We used DS13-v2’s for all clients and scaled down TPC-E workload to 800,000 customers with data size at 800GB.

 

Azure Blob Cache is the key for the best price/perf

For the first test we used 2 of Premium SSD P30 disks for SQL Server data file and 1 Premium SSD P20 disk for SQL Server log file. We enabled ReadOnly cache for both P30 disks and created a drive with disk striping for SQL Server data file. Data drive had 10,000 IOPS and 400MB/sec throughput capacity with 2-P30 disks and log drive had 2300 IOPS and 150 MB/sec throughput capacity with 1 P20 disk. We used SQL Server 2017 Enterprise Edition with Windows Server 2016 Data Center with SQL Server defaults except that Lock Pages in memory is enabled and max server memory is set to 90%. Data and Log files are located on separate drives and Temp DB files are located on local SSD (D: drive).

 

In the first test, workload drove 18,403 IO per second and reached up to 490 TPS (Transaction Per Second) with 256 concurrent users (Table-1). That is a great price/performance optimization level as the paid IO capacity is used only for writes (9,668 write IOPS served by 2-P30 disks) and all reads (8,735 total read IOPS) are served from the blob cache. This is a huge benefit for ready heavy workloads as all the read IOPS are served directly from the host cache with very low response times and did not occur any additional charges.

 

Table1.png

 

Table 1- E64s_v3, 2-P30 for data and 1 P20 for Log

 

Scale up application throughput by simply by adding more storage capacity

The first test was bottlenecked on the writes as 2- P30 disks are throttled at 10,000 IOPS. We repeated this test with 4 P30 disks stripped on a single drive (all disks have ReadOnly cache enabled) to host SQL Server data file and 1 P20 disk for SQL Server log file. The same workload scaled up to 823 TPS with 67% increase on the application throughput. Running 823 TPS (14,672 batch requests/sec) required total 37K IO per second (Table -2). Again, 4 P30 disks are used only for the writes (18,978 writes IOPS) and all reads are served from the free blob cache (17,809 read IOPS).

 

To scale up the workload and increase the throughput start with adding additional storage capacity until CPU becomes the bottleneck. With 823 TPS on E64s_v3, the CPU was only consumed at 45%, there is still significant bandwidth on this VM to increase throughput by simply increasing storage capacity.

 

 

table2.png

 

Table 2- E64s_v3, 4-P30 for data and 1 P20 for Log

 

Maximize throughput with lower storage response times

Premium Disks has great price/performance advantages with ReadOnly caching and monthly low-end storage cost. If your workload requires very low storage response times, then you can use ultra-disk to get microsecond level IO latencies at very high IOPS. Azure ultra-disks deliver high throughput, high IOPS, and consistent low latency disk storage for Azure VMs.

 

With the same test repeated with SQL server data and log files on Ultra Disk, we got up to 1,489 TPS and utilized all VM resources at peak (the CPU is consumed at 92%). Single ultra-disk provided 60,000 total IOPS (31,431 read IOPS and 29,250 write IOPS) and total 964 MB/sec throughput with microsecond level response times (Table-3).

 

table3.png

 

Table 3- E64s_v3, Ultra Disk for Data and Log

 

Premium SSD delivers great performance for write heavy workloads

If you are running a write heavy workload with simple transactions, then you can validate performance with the TPC-C benchmark. Hammer DB TPC-C [2] is a tool that can be used to simplify TPC-C benchmarking. We run Hammer DB TPC-C with 1000 warehouses at 100GB total size. Test server is configured with SQL Server 2017 Enterprise edition on E64_v3; data files located on a storage pool stripped over 2-P30 disks (ReadOnly cache enabled), log file is located on a single P20 disk and Temp DB files are hosted on Local disk. With this test, workload reached to 936,896 TPM (Transaction Per Minute) as total IOPS are throttled at 10,000 with 2-P30 disks (Table - 4).

 

table4.png

 

Table 4 – E64_v3, 2 P30 for Data, 1 P20 for Log

 

Note that, on this run CPU utilization was only at 12%. Can we double the throughput by simply adding more storage capacity? The answer is yes, simply by adding 2 more P30 drives, workload reached to 1.6 million TPM (Table - 5).

 

table5.png

 

Table 5- E64s_v3, 4 P30 for Data and 1 P20 for log.

 

Write heavy workloads modify data in memory at a frequent rate. Checkpoint process writes the in-memory modified pages (known as dirty pages) and transaction log information from memory to disk. For write heavy workloads, SQL Server performs intensive IO activity to achieve the 1-minute default recovery time.

 

To show the impact of the checkpoint process on throughput, we repeated the same test with recovery interval set to the maximum value (checkpoint processes is disabled). When recovery interval is set to maximum, the HammerDB TPC-C workload doubled the throughput and reached up to 3,2 million TPM (Table - 6).

 

table6.png

 

Table 6 – E64s_v3, Data on 4-P30, Recovery Time is set to max.

 

This setting was experimental only and cannot be used on production environments. But recovery time interval can be relaxed to increase the throughout for write heavy workloads modifying millions of pages per minute. If aiming for recovery in ~5 minutes or more is acceptable for the workload, then relaxing the recovery time interval setting will enable higher throughput at the same cost.

With a wide range of VM series and sizes, Premium SSD and Ultra Disks Azure offers many option to design for your workloads’ specific performance requirements. Leverage the performance best practices to boost throughput for your OLTP workload with SQL Server workloads with Azure VMs. Click here to start testing with free SQL Server Developer edition images on Azure VMs.

 

[1] Scaled down TPC-E model reduces the initial footprint of the database.  It is primarily used for ease of benchmarking; we reduced the amount of history rows and then instruct the driver to not search too far back.  For our tests, we reduced the number of trade days in the history table from 300 to 30. Please note that results from the scaled down model are non-comparable to the published results.

 

[2] HammerDB provides an implementation of the TPC-C benchmark. HammerDB TPC-C is derived from TPC-C and as such is not comparable to published TPC-C results, and the HammerDB TPC-C results do not fully comply with TPC-C.