As the Red Hat OpenShift Virtualization Performance & Scale Engineering team, we cover a variety of tuning and workload topics in our blogs and in the official Tuning & Scaling Guide, and we continue to work with multiple customers to ensure that they can achieve competitive Microsoft SQL Server (MSSQL) performance in OpenShift VMs. Following our general VM Configuration Best Practice Guide--which highlights critical tuning topics for all workload types--this writeup will focus on additional tuning options that can significantly improve the performance of SQL Server performance, summarizing key settings we’ve used to resolve competitive gaps. If your database throughput is significantly lower than expected and your SQL write latency looks much higher than expected for your storage environment, the following tunings should be considered to resolve common bottlenecks.
Summary of the most critical recommendations
- For Windows VMs, update to the latest virtio-win driver version, especially v1.9.62 (version 100.104.104.30300 or newer) for
bus: virtiodisks: https://access.redhat.com/downloads/content/virtio-win - Configure VMs with cache=directsync if the underlying storage is writethrough
In our own lab testing we have measured these two recommendations alone can significantly improve SQL Server throughput and latency. For reference, below are some examples of the magnitude of TPM (transaction per min) improvements provided by these recommendations in internal lab runs using fast local storage. Note that for storage environments with higher latency, or for higher hammerDB user counts, the improvements could increase further but these data points were chosen to help illustrate the significant improvements that can be achieved:

Note that configuring multiple IOthreads and static hugepages may provide minor performance improvements as well and keep in mind that the VM Preference and host CPU sleep states can play a big role in some cases, as described in the VM Configuration Best Practice Guide.
For full configuration details on these example runs, see the Appendix.
[Windows-only] virtio-win improvements for bus: virtio disks
It is highly recommended to update to virtio-win-1.9.62 (or newer), which provides viostor driver version 100.104.104.30300. This version includes a critical queue performance optimization for bus: virtio disks (i.e. virtio-blk devices using the viostor driver).
Note: the latest virtio-win isos can be found here: https://access.redhat.com/downloads/content/virtio-win
For example: to update the driver, mount the iso as a cdrom (or transfer the contents to the VM) and run the install wizard by executing virtio-win-guest-tools.exe
Troubleshooting Tips
To check the currently installed viostor driver version, from inside the guest:
- From PowerShell, run:
pnputil /enum-driversand look for the Driver Version for viostor.inf
or
- From the UI, navigate to: Device manager -> Storage Controllers -> (right click) Red Hat Virtio SCSI controller -> Properties -> select the Driver tab to display the Driver Version
Flushing
One very important topic that comes up in most MSSQL performance evaluations is flushing behavior. Since SQL Server 17, a “forced flush” mechanism (described in this reference for the Linux implementation, however flushing behavior is similar for SQL Server running in Windows) basically means that every database write (i.e. checkpoint, log write) is followed by a flush to ensure durability. However this may not be strictly required if the backing storage provides writethrough support, for instance typically in the case of arrays this is provided by a battery-backed cache.
Assuming the underlying device does present as writethrough (see the Troubleshooting Tip below), “directsync” is a KVM cache mode that can be used to configure "write-cache:off" in qemu which can optimize this forced flushing by informing the virtualized I/O stack to use writethrough behavior. This basically means the flushes are safely "skipped", which can relieve large bottlenecks and reduce the overall I/O requirements of the database load.
Support for directsync cache mode is tracked here: CNV-86858
And backports are currently tracked in:
- 4.22.z: CNV-100204
- 5.0.z: CNV-100205
This blog will be updated once the feature is fully released.
In order to test a preview on older cluster versions, we can utilize a sidecar that changes the cache mode to directsync for all disks. A full sidecar configuration example is provided here: https://gist.github.com/jeniferh/9b98be6252cdb767a0744534144401ab
Note that sidecar configuration changes are not officially supported, however this can help you demonstrate the capabilities of this feature while it's pending release.
Windows VM note: this works as-is for bus: scsi drives, for bus: virtio drives ensure the installed virtio driver version includes this fix:
https://access.redhat.com/errata/RHBA-2026:43594
Fixed in virtio-win-1.9.58 (viostor version 100.103.104.30000): Virtio-win may not configure guest cache mode when using virtio-blk [rhel-10.2.z] (JIRA:RHEL-192590)
And note the newer virtio-win-1.9.62 (viostor version 100.104.104.30300) also includes a critical queue performance optimization for bus: virtio disks. The latest virtio-win isos can be found here: https://access.redhat.com/downloads/content/virtio-win
FUA
Note that FUA (Forced Unit Access) is another I/O setting that uses a flag to force writethrough behavior at the individual request layer. Both FUA and directsync accomplish the same basic optimization for forced flushing, there is no need to explicitly enable both, generally directsync is the recommendation because some devices do not support FUA.
Note that if the underlying device does support FUA, (starting in 4.22) a VM configured with rhel-9.8.0+ machine type with bus: scsi disks will automatically enable FUA support for the drive. SQL Server running in Windows VMs will automatically pick up this optimized flushing behavior. SQL Server running in Linux does require the T3979 trace flag to enable this behavior.
Guest-side cache mode
Another way to achieve the same optimized flushing behavior is to configure the guest-side cache mode to be write-through.
For Windows VMs, this can be accomplished by “unchecking” the disk write-caching policy for each drive:
File Explorer -> This PC -> (right click) drive to change -> Properties -> Hardware tab -> (select disk, note there are no bus ids so you may wish to change all) -> Properties -> Change Settings button. From this menu, “uncheck” the Write-caching policy box.
For Linux VMs, this can be accomplished by changing the disk cache_type or using udev rules, see this article for more information: https://access.redhat.com/solutions/7094525
Troubleshooting Tips
- To check if the underlying storage is write-through:
# grep . /sys/devices/virtual/block/*/queue/write_cache
# find /sys/ -name write_cache -exec grep -H . {} \;hint: ls -l /dev/mapper/ can be helpful as well
- To check if the underlying storage supports FUA:
# dmesg | grep FUAthis output is often helpful to check if FUA is not supported, example message: “doesn't support DPO or FUA”
and:
# grep . /sys/block/*/queue/fua |grep ":1"1 means FUA is supported
- To get an idea of the overall flushing impacts, check the disk stats for the VM using the appropriate virt-launcher pod name:
oc exec -it virt-launcher-$name -- virsh domstats 1Looking at the domstats output, determine which block id is used for the data and log disk (check the block.$id.name and path for help), and compare wr (write) data to fl (flush) data.
An example domstats output is shared below from an internal lab test showing heavy flushing activity on the data disk. Note that fl.reqs totals are similar to wr.reqs, meaning near 1:1 flush to write behavior which indicates the SQL forced flush behavior is active. And note that fl.times can often grow in some cases much higher than wr.times, indicating a large flushing bottleneck:
block.1.wr.reqs=54,762,762
block.1.wr.bytes=895,794,880,512
block.1.wr.times=48,176,291,067,598
block.1.fl.reqs=54,761,042
block.1.fl.times=478,645,467,450,137
All times listed in these stats are in nanoseconds. Keep in mind these values accumulate since guest boot time, so it can also be very helpful to collect domstats and diff the “before” and “after” for a short collection period (a couple minutes is usually enough) while the VM database load is active to get a more accurate measurement.
Note that once directsync cache mode is enabled, fl.reqs totals are expected to be very low (or none) during SQL Server runs due to the optimized behavior.
IOthreads
The supplementalPool ioThreadsPolicy (starting in 4.19) allows VMs to more efficiently utilize both vcpus and host cpus for periods of highly threaded I/O load. As described in the feature introduction, typically allocating 4 or 8 threads per VM is enough for many storage and workload environments. If a VM has many heavily utilized disks, consider evaluating higher thread counts since the pool is shared among all drives.
Note that extending the ioThreadsPolicy option to bus: scsi is planned, as well as improvements to the “auto” policy behavior, as tracked in: CNV-59316
This blog will be updated once the feature is fully released.
In order to test a preview on older cluster versions, we can utilize a sidecar that applies IOthreads to the scsi controller. A sidecar configmap example, building on the previous directsync sidecar example in the Flushing section above, is provided here: https://gist.github.com/jeniferh/614bc2911229cbf7b4a5b5a7efb271ff
Note that sidecar configuration changes are not officially supported, however this can help you demonstrate the capabilities of this feature while it's pending release.
Windows-only Settings
Power Plan
Especially for database workloads, the Windows Power Plan should be set to High Performance, not Balanced -- this is a guest side setting.
Example PowerShell to query the active Power Plan:
Get-CimInstance -Namespace root\cimv2\power -ClassName Win32_PowerPlan | Where-Object IsActiveExample PowerShell to set High Performance:
$powerPlan = Get-WmiObject -Namespace root\cimv2\power -Class Win32_PowerPlan -Filter "ElementName = 'High Performance'"
$powerPlan.Activate()Workload Best Practices
SQL Settings
Consider using common best practice SQL tuning such as the following.
Increase autogrowth values in DB Properties->Files:
Autogrowth size: Data: 10240 in MB (10GB), Log: 1024 In MB (1GB)
Adjust server cost and optimization values in Server Properties:
Cost Threshold for Parallelism: 50
Optimize for Ad hoc Workloads: True
Max Server Memory:
Configure a fixed upper limit for Max Server Memory (leaving appropriate headroom for the underlying operating system) to prevent SQL Server from aggressively consuming all available memory and causing memory pressure on the VM. See the Microsoft documentation for this setting.
HammerDB Config
Generally it can be useful to characterize a ramp up of increasing user count values to observe throughput at various usage levels. Ensuring a sufficient ramp-up duration is especially important at high user counts (e.g., 200+) to give all virtual user threads enough time to initialize smoothly, while extending the runtime duration to 10 minutes or more ensures stable and consistent steady-state results.
For a fair comparison, tests should use the same version of the HammerDB client, as behavior changes across client updates can impact the final TPM and NOPM scores.
Storage Considerations
After applying the optimizations covered above, if performance is still not reaching the expected values consider if any storage path tuning is required.
Some areas that may require further study
- CSI Replication: If using in-cluster replication values higher than 1, understand and characterize the implications on write performance.
- StorageClass options: Work with your storage vendor to understand if there are any settings that can be applied, especially to optimize database workloads. Options may include changing submission sizes, enabling “direct” and/or “fast” bypass modes, or applying specific workload profile options.
- Understand if the iSCSI and/or Fibre Channel configuration is following all recommended best practices (if appropriate) as well as any multipath or udev settings, as recommended by each storage vendor.
Troubleshooting tip
In some cases it can be useful to collect I/O baselines to measure and characterize CSI performance before moving on to tuning database workloads. One methodology that has been helpful in past investigations is to configure an LVM StorageClass on the target storage device (i.e. configure a local disk or allocate a LUN from the array) to provide a set of known low-overhead baselines for various fio patterns, which can then be repeated using the target CSI-provided StorageClass to help ensure overall I/O performance meets expectations. See this blog for more tips on running fio workloads in VMs.
FAQs
vCPU topology
Typically most workloads perform best when following these vCPU topology guidelines:
For Linux VMs, configure vCPUS as “sockets”, ex:
cpu:
cores: 1
sockets: 8
threads: 1For Windows VMs, configure vCPUS as “cores”, ex:
cpu:
cores: 8
sockets: 1
threads: 1Generally we don’t recommend increasing the “threads” topology except for some very strictly pinned cases where it is ensured the physical topology matches the guest sibling thread topology. Similarly, matching the core and socket topology of the host (i.e. 4 cores 2 sockets) is not generally recommended unless the workload itself has a strict requirement for such a topology.
Pinning / dedicatedCPUs
Generally for competitive throughput workload performance, pinning VMs (i.e. using dedicatedCPUs) is not recommended. Pinning relies on the CPUManager and other kubelet policies, which in most cases will pack VMs onto logical cpus meaning that hyperthread usage may be “forced” and VMs will pack onto 1 NUMA node before splitting on to the next vs. letting the host scheduler decide the best placement. This type of tuning is best reserved for cases that require strict isolation to achieve very low latency (i.e. sub millisecond), for example network workloads with zero packet loss tolerance.
bus: scsi
Generally bus: scsi and bus: virtio may perform somewhat similarly if configured with the same cache mode and IOthread options, although the exact performance differences depend on the specific I/O pattern and storage backend, while overall bus: virtio may provide slightly higher performance on average. Note that bus: scsi is required for higher disk hotplug totals and SCSI persistent reservations and command pass-through.
Appendix
For the example tuning uplift charts, the following configuration was tested -- note that differences across storage/network/compute environments may provide significantly different results, and these are just provided as an example from lab testing:
- Worker (host) config:
- Intel(R) Xeon(R) Gold 6438Y+ (Sapphire Rapids); 32core x 2 socket x HT = 128 cpus (64c)
- 256GB memory
- LVM configured on local NVMe (PCI attached)
- Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller PM173X (prog-if 02 [NVM Express])
- Subsystem: Dell EMC PowerEdge Express Flash Ent NVMe AGN MU AIC Gen4 6.4TB
- Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller PM173X (prog-if 02 [NVM Express])
- C1 Tuned applied for all tests: https://gist.github.com/jeniferh/d675e26e61f582644293b731130052e0
- VM and workload config:
- Windows server 2025
- Hammerdb v4.12, ODBC Driver 18 for SQL Server
- 32vcpu, 180GB mem VM configured with 1G hugepage backing and 4 supplementalPool IOthreads
- “medium” DB size: 500 Warehouse MS SQL Server TPROC-C schema, (users=100), ramp up: 2m, test duration: 10m
- “small” DB size: 200 Warehouse MS SQL Server TPROC-C schema, (users=10), ramp up: 2m, test duration: 10m
Acknowledgements
The Performance team would like to thank Kevin Wolf, Stefan Hajnoczi, Martin Necas, and Michal Skrivanek for their Engineering leadership and support for these tuning optimizations.