Sql-server – SQL Server Trace Flag 834 on VMware

performanceperformance-tuningsql servervmware

It's recomended to enable trace flag 834 to use large-page on buffer pool for SQL Server running on VMware?

The tuning options kb of Microsoft (https://support.microsoft.com/en-us/kb/920093) don't mentions anything about virtualization and I have read somewhere that is mostly for dedicated machines.

Let's assume that the VM is more than 64GB in RAM and it's presented a topology of 2 v-sockets with 8 v-cores per socket for a 16 v-core VM.

Is the trace flag of help inside the hypervisor?

Best Answer

Large Pages change allocation of memory from 4KB to 2MB (normally), which means that the TLB (translation look-aside buffer) is improved in the CPU increasing the performance.

I've successfully used Trace flag 834 on production server in VMware for over a year. One important part before enable trace flag is that in VMware you should reserve at least the amount of memory dedicated to SQL Server, this is because the lock-pages in memory privilege required to enable large pages, "locks" the memory so it can't be swapped (paginated) to disk. So if the balloning driver kicks in, it won't try to force to reclaim memory from SQL Server.

Additionally the host should not be overcommitted in memory, if so it will degrade performance.

It should be carefully tested if there is a performance gain, so if unsure, just don't enable it. Also I have read that "Large Pages May Be Harmful on NUMA Systems" but I'm not sure if it applies to Windows/SQL Server

Trace flag 834 applies only to 64-bit versions of SQL Server. You must have the Lock pages in memory user right to turn on trace flag 834. You can turn on trace flag 834 only at startup.