| title | How to configure persistent memory (PMEM) for SQL Server on Linux | Microsoft Docs |
|---|---|
| description | This article provides a walk-through for configuring PMEM on Linux. |
| author | DBArgenis |
| ms.author | argenisf |
| manager | craigg |
| ms.date | 09/24/2018 |
| ms.topic | conceptual |
| ms.prod | sql |
| ms.custom | sql-linux |
| ms.technology | linux |
| monikerRange | >= sql-server-ver15 || = sqlallproducts-allversions |
[!INCLUDEappliesto-ss-xxxx-xxxx-xxx-md-linuxonly]
This article describes how to configure the persistent memory (PMEM) for SQL Server on Linux. PMEM support on Linux was introduced in SQL Server 2019 CTP 2.0.
SQL Server 2016 introduced support for Non-Volatile DIMMs, and an optimization called Tail of the Log Caching on NVDIMM that shortened the amount of operations needed to harden a log buffer to persistent storage. This leverages Windows Server’s capability to directly access a persistent memory device in DAX mode.
SQL Server 2019 preview extends the support for persistent memory (PMEM) devices to Linux, providing full enlightenment of data and transaction log files placed on PMEM. Enlightenment refers to the method of access to the storage device using efficient user-space memcpy operations. Rather than going through the file system and storage stack, SQL Server leverages the DAX support on Linux to directly place data into the devices, incurring into minimal latency.
To enable enlightenment of database files in SQL Server on Linux, follow the following steps:
- Configure the devices
In Linux, this is performed using the
ndctlutility.
- Install install
ndctlto configure pmem device. You can find it here. - Use [ndctl] to create a namespace.
ndctl create-namespace -f -e namespace0.0 --mode=fsdax* –map=memNote
If you are using ndctl version lower than 59, use --mode=memory.
Use ndctl to verify the namespace. Sample output follows:
ndctl list
[
{
"dev":"namespace0.0",
"mode":"memory",
"size":1099511627776,
"blockdev":"pmem0",
"numa_node":0
}
]-
Create and mount pmem device
For example, with XFS
mkfs.xfs -f /dev/pmem0 mount –o dax,noatime /dev/pmem0 /mnt/dax xfs_io -c "extsize 2m" /mnt/daxFor example, with EXT4
mkfs.ext4 -b 4096 -E stride=512 -F /dev/pmem0 mount –o dax,noatime /dev/pmem0 /mnt/dax
Once the device has been configured with ndctl, formatted and mounted, you can place database files in it. You can also create a new database
-
Enable SQL Server database file enlightenment by using trace flag 3979. This trace flag is a startup trace flag, and as such needs to be enabled using the mssql-conf utility.
-
Restart SQL Server.
For more information about SQL Server on Linux, see SQL Server on Linux.