SAP AG has developed several standard application benchmarks. The Sales and Distribution workload represents one of the important classes of workloads that are used to benchmark SAP enterprise resource planning installations. The updates to SAP include added requirements, such as subsecond response time and a Unicode code page. For more information, see SAP with Microsoft SQL Server 2008 and SQL Server 2005: Best Practices for High Availability, Maximum Performance, and Scalability.
You can perform multidimensional tuning of the operating system level, application server, database server, network, and storage to achieve optimal throughput and good response times as the number of concurrent sales and distribution users increases before performance levels off because of resource limitations.
The following sections provide guidelines that can benefit two and three tier configurations for sales and distribution benchmarks for SAP enterprise resource planning in Windows Server2012. Some of these recommendations might not apply to the same degree for production systems.
Operating System Tunings on the Server
Navigate to Control Panel > System > Advanced System Settings > Advanced tab and configure the following:
-
Navigate to Performance Settings > Advanced > Virtual memory, and then set one or more fixed-size page files (set the Initial Size equal to Maximum Size). The page file size should meet the total virtual memory requirements of the workload. Make sure that no system-managed page files are in the virtual memory on the Application Server.
-
Navigate to Performance Settings > Visual Effects, and then select the Adjust for best performance check box.
-
To enable SQL to use large pages, configure the Lock pages in memory user right assignment for the account that will run the SQL and SAP services.
-
From the Group Policy MMC snap-in (Gpedit.msc), navigate to Computer Configuration > Windows Settings > Security Settings > Local Policies > User Rights Assignment. Double-click Lock pages in memory and add the accounts that have credentials to run Sqlservr.exe and SAP services.
-
Navigate to Start > All Programs > Administrative Tools > System Configuration > Tools tab, select Disable UAC, and then reboot the system.
Note The UAC setting can be used for benchmark environments, but enabling UAC might be a security compliance requirement in production environments.
For a virtualized configuration, these settings apply across the host and virtual machine operating systems. For latency sensitive virtualized configurations, to partition network I/O processing from SAP computing resources, consider limiting the number of logical processors that are available for the VMQ interrupt processing. This can be accomplished by configuring the base and maximum RSS logical processors.
Tunings on the Database Server
When the database server is running SQL Server, consider setting the following SQL Server configuration options by using sp_configure. For detailed information about the sp_configure stored procedure, see Server Configuration Options.
-
Apply CPU affinity for the SQL Server process.
Set an affinity mask to partition the SQL Server process on specific cores. If required, use the affinity64 mask server configuration option to set the affinity on more than 32 cores. In SQL Server 2012 and SQL Server 2008 R2, you can apply equivalent settings for configuring CPU affinity on as many as 640 logical processors by using the ALTER SERVER CONFIGURATION Transact-SQL statement because the sp_configure affinity mask options are announced for deprecation.
Note For the current two-tier SAP Sales and Distribution benchmarks, it is typically sufficient to run SQL Server on one-eighth or fewer of the existing cores.
-
Set a fixed amount of memory that the SQL Server process will use.
For example, set the max server memory and min server memory equal and large enough to satisfy the workload (2500 MB is a good starting value).
On NUMA-class hardware, you can do the following:
-
For information about how to subdivide the CPUs in a hardware NUMA node into more CPU nodes (known as Soft-NUMA), see Configure SQL Server to Use Soft-NUMA.
-
To provide NUMA node locality for SQL Server, set preferred NUMA node hints (applies to Windows Server 2012 and Windows Server 2008 R2). For the following commands, use the service name. The [server] parameter is optional, the other parameters are required:
Use the following command to set the preferred NUMA node:
%windir%\system32\sc.exe [server] preferrednode
You need administrator permissions to set the preferred node. Run %windir%\system32\sc.exe preferrednode to display Help text.
Use the following command to query the setting:
%windir%\system32\sc.exe [server] qpreferrednode
This command fails if the service has no preferred node settings. Run %windir%\system32\sc.exe qpreferrednode to display Help text.
Use the following command to remove the setting:
%windir%\system32\sc.exe [server] preferrednode -1
On a two-tier native enterprise resource planning SAP setup, consider enabling and using only the Named Pipes protocol and disabling the rest of the available protocols from the SQL Server Configuration Manager for the local SQL connections.
If SQL Server is running in a dedicated system or virtual machine, the recommended protocol is TPC/IP.
Tunings on SAP Application Server
The ratio between the number of Dialog (D) processes versus Update (U) processes in the SAP enterprise resource planning installation might vary, but usually a ratio of 1D:1U or 2D:1U per logical processor is a good start for the Sales and Distribution workload. Ensure that in a SAP dialog instance, the number of worker processes and users does not exceed the capacity of the SAP dispatcher for that dialog instance (the current maximum is approximately 2,000 users per instance).
On NUMA-class hardware, consider installing one or more SAP dialog instances per NUMA node (depending on the number of logical processors per NUMA node that you want to use with SAP worker processes). The D:U ratio, and the overall number of SAP dialog instances per NUMA node or system, might be improved based on the analysis of previous experiments.
For large virtual machines that span multiple NUMA nodes, virtual NUMA is available by default and can be used to partition dialog instances. For more information, see Virtualizing SAP Applications on Windows.
For smaller virtual machines without virtual NUMA, the preferred NUMA node can be configured for each virtual machine for better load balancing and performance.
To further partition computing resources within an SAP instance, use the processor affinity capabilities in the SAP instance profiles to partition each worker process to a subset of the available logical processors. This provides better CPU and memory locality. The affinity setting in the SAP instance profiles is supported for 64 logical processors. The affinity setting is not recommended when running SAP worker processes inside a virtual machine because experiments have shown that SAP latency can be improved by allowing the guest and hypervisor schedulers to better allocate CPU resources.
For large scale virtualized deployments, the selection of VMQ processors can be altered to better partition SAP virtual machines from root network I/O processing. Consider restricting the VMQ processors to logical processors (and NUMA nodes) on which contention with SAP virtual machines is minimized. This may improve latency for heavily loaded configurations.
Use the flat memory model that SAP AG released in November 2006, with the SAP Note No. 1002587 (Flat Memory Model on Windows) for SAP kernel 7.00 patch level 87.
In Windows Server 2012 and Windows Server 2008 R2, the operating system supports more than 64 logical processors. On such NUMA-class systems, consider setting preferred NUMA nodes in addition to setting hard affinities by using the following steps:
-
Set the preferred NUMA node for the SAP Win32 service and SAP Dialog Instance services (processes instantiated by Sapstartsrv.exe). When you enter commands on the local system, you can omit the server parameter. For the following commands, use the service short name.
-
Use the following command to set the preferred NUMA node:
%windir%\system32\sc.exe [server] preferrednode
You need administrator permissions to set the preferred node. Run %windir%\system32\sc.exe preferrednode to display Help text.
-
Use the following command to query the setting:
%windir%\system32\sc.exe [server] qpreferrednode
This command fails if the service has no preferred node settings. Run %windir%\system32\sc.exe qpreferrednode to display Help text.
-
Use the following command to remove the setting:
%windir%\system32\sc.exe [server] preferrednode -1
-
To allow each SAP worker process in a dialog instance to inherit the ideal NUMA node from its Win32 service, create registry key entries under the following key for each of the Sapstartsrv.exe, Msg_server.exe, Gwrd.exe, and Disp+work.exe images, and then set the "NodeOptions"=dword:00000100 value as follows:
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ (IMAGE NAME)\ (REG_DWORD)
-
If the preferred NUMA node is used without hard affinity settings for SAP worker processes, or if time measurement issues are observed as described by SAP Note No. 532350 released in November 2004, apply the recommendation to let SAP processes use the Query Performance Counter (QPC) timer to stabilize the benchmark environment. Set the following system environment variable:
%windir%\system32\setx.exe /M SAP_USE_WIN_TIMER YES
You can use the Coreinfo tool from Windows Sysinternals to provide topology details about logical and physical processors, processor sockets, NUMA nodes, and processor cache. For more information, see Map TCP/IP Ports to NUMA Nodes.
Share with your friends: |