diff --git a/adoc/SLES-SQL-server-linux.adoc b/adoc/SLES-SQL-server-linux.adoc index 9ac52f17..9ef44b5f 100644 --- a/adoc/SLES-SQL-server-linux.adoc +++ b/adoc/SLES-SQL-server-linux.adoc @@ -146,11 +146,12 @@ sudo zypper install -y mssql-server mssql-tools18 unixODBC-devel glibc-locale-b === Initial configuration -This section is covering the OS modification, the NIC configuration, the recommanded storage setup and the {sqls} configuration. +This section is covering the OS modification, the NIC configuration, the recommended storage setup and the {sqls} configuration. ==== OS configuration (CPU, Kernel, Memory) -.CPU/sysctl/disk/memory setting +[discrete] +==== CPU/sysctl/disk/memory setting {sles} contains a `TuneD` profile for mssql (within the `tuned` package), but it's not according to the {sqls} best practices guide. The next steps describe and line out the changes recommended for {sqls}. Using TuneD it automatically configures CPU frequency governor, ENERGY_PERF_BIAS, and min_perf_pct settings appropriately due to the `throughput-performance` profile being used as base for the `mssql profile`. C-States parameter must be configured manually. The disk readahead section is also covered by including the file `throughput-performance`, please check the settings if they are equal and skip them if not needed. @@ -242,7 +243,9 @@ tuned-adm verify cat /var/log/tuned/tuned.log ---- -.Intel CPU C-state +[discrete] +==== Intel CPU C-state + Adapting the Intel C-state setting by appending intel_idle.max_cstate and processor.max_cstate to the kernel command line. The appropriate BIOS settings are essential. [source,shell] @@ -267,7 +270,8 @@ After the reboot verify the setting is persistent. cat /proc/cmdline ---- -.Tunning storage IO +[discrete] +==== Tunning storage IO INFO: As multipath I/O is often used for {sqls} deployments, configure the device mapper (DM) multi-queue target to use the blk-mq infrastructure, by enabling the dm_mod.use_blk_mq=y kernel boot option. The default value is n (disabled). This setting, when the underlying SCSI devices are using blk-mq, reduces locking overhead at the DM layer. For more information on how to configure multipath I/O, can be found at https://documentation.suse.com/sles/15-SP6/single-html/SLES-storage/#cha-multipath or https://www.suse.com/support/kb/doc/?id=000021020 @@ -316,7 +320,8 @@ cat /sys/block/sd?/queue/scheduler The network setting depend on the used NIC hardware. Some of the following configuration changes maybe can't be made or have different possible values as shown. In the following step the execution as root user is described. If the root access is not possible the `sudo` command must be added in front of each command. -.Configuring network port buffer size +[discrete] +==== Configuring network port buffer size In the example below, the NIC is named eth1, which is an Intel-based NIC. For Intel based NIC, the recommended buffer size is 4 KB (4096). The value to use here depends on the maximum values recommended for each NIC type and vendor. Make the `ethtool` option persistent by adding them to the ifcfg file for each interface (last line). @@ -362,7 +367,8 @@ ethtool -G eth1 rx 4096 tx 4096 ethtool -g eth1 ---- -.Enable jumbo frames +[discrete] +==== Enable jumbo frames Before enabling jumbo frames, verify that all the network switches, routers, and anything else essential in the network packet path between the clients and the {sqls} support jumbo frames. Add a line in the ifcfg file and set the MTU size. @@ -400,7 +406,8 @@ RECONFIGURE WITH OVERRIDE; GO ---- -.Setting the port for adaptive RX/TX IRQ coalescing +[discrete] +==== Setting the port for adaptive RX/TX IRQ coalescing Meaning interrupt delivery is adjusted to improve latency when the packet rate is low and improve throughput when the packet rate is high. This setting might not be available across all the different network infrastructures, so review the existing network infrastructure and confirm that this is supported. The example below is for the NIC named eth1, which is an Intel-based NIC. @@ -425,7 +432,9 @@ ethtool -C eth1 adaptive-rx on adaptive-tx on ethtool -c eth1 ---- -.It is recommended receive-side scaling (RSS) is enabled and by default, combining the RX and TX side of RSS queues +[discrete] +==== RX and TX side of RSS queues +It is recommended receive-side scaling (RSS) is enabled and by default, combining the RX and TX side of RSS queues There have been specific scenarios, when working with Microsoft Support, where disabling RSS has improved the performance as well. Test this setting in test environments before applying it on production environments. The following example is for Intel NICs. [source,shell] @@ -467,7 +476,6 @@ firewall-cmd --permanent --add-port=135/tcp --add-port=1433/tcp && firewall-cmd .Check the configuration [source,shell] -[source,shell] ---- firewall-cmd --list-ports ---- @@ -605,7 +613,8 @@ The following options are use to do a simple setup for a host with 1TB RAM. /opt/mssql/bin/mssql-conf set memory.memorylimitmb 950000 ---- -.Initial setup and start of {sqls} +[discrete] +==== Initial setup and start of {sqls} Finally configure and start `msql-server` (`mssql-conf` starts the `msql-server` immediately after configuring), run the following command: @@ -683,8 +692,8 @@ Microsoft SQL Server 2022 (RTM-CU15-GDR) (KB5046059) - 16.0.4150.1 (X64) (1 row affected) ---- -.Tempdb files movement to a dedicate storage area - +[discrete] +==== Tempdb files movement to a dedicate storage area By default, a new installation of SQL Server on Linux creates multiple tempdb data files, based on the number of logical cores (with up to eight data files). One of our preparation steps for the storage part was having a dedicated RAID set for the tempdb files. This setting can only be modified from inside the {sqls}. The following example moves `tempdb` from its current default location on the disk to another disk location. Because tempdb is re-created each time the @@ -752,7 +761,8 @@ Delete the tempdb.mdf and templog.ldf files from their original location. With {sqls} 16 more memory specific improvements are made with can be enabled. For more detais and {sqls} specific internal tunnings follow the official documentation from Microsoft. https://learn.microsoft.com/en-us/sql/relational-databases/in-memory-database?view=sql-server-linux-ver16#memory-optimized-tempdb-metadata -.Further {sqls} configuration modification +[discrete] +==== Further {sqls} configuration modification For further configuration, use `mssql-conf` to set additional parameters. Changes will take effect after a restart: [source,shell] @@ -798,8 +808,9 @@ writethrough = 1 alternatewritethrough = 0 ---- +// == High Avaibility Setup - +// == Tools @@ -1085,7 +1096,7 @@ https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-suse?view === Virtual machines and dynamic memory -If you're running SQL Server on Linux in a virtual machine, make sure you select options to fix the amount of memory reserved for the virtual machine. Don't use features like Hyper-V Dynamic Memory. +If you're running {sqls} on Linux in a virtual machine, make sure you select options to fix the amount of memory reserved for the virtual machine. Don't use features like Hyper-V Dynamic Memory. The feature for KVM is called memballoon and can be set to none in the VM configuration. The default is virtio. .KVM memballoon