PerformanceTuningGuideSQL_803405

15
Performance Tuning Guide: SQL Server Vista/Vantage 8.03.405 Version Published by: Epicor Software Corporation 2000 Interchange Tower 600 S. Highway 169 Minneapolis, Minnesota 55426 ©2008 by Epicor Software Corporation. All rights reserved. Document Version May 2008 Epicor and Manufacturing Systems are registered trademarks of Epicor Software Corporation. Microsoft and MS-DOS are registered trademarks of Microsoft Corporation. Windows, Windows XP, and Windows 2000 are trademarks of Microsoft Corporation. Progress is a registered trademark of Progress Software Corporation. All other product names are copyright and registered trademarks/tradenames of their respective owners.

Transcript of PerformanceTuningGuideSQL_803405

Page 1: PerformanceTuningGuideSQL_803405

Performance Tuning Guide:

SQL Server

Vista/Vantage 8.03.405 Version

Published by:Epicor Software Corporation 2000 Interchange Tower600 S. Highway 169 Minneapolis, Minnesota 55426

©2008 by Epicor Software Corporation. All rights reserved.

Document Version May 2008

Epicor and Manufacturing Systems are registered trademarks of Epicor Software Corporation.Microsoft and MS-DOS are registered trademarks of Microsoft Corporation. Windows, Windows XP, and Windows 2000 are trademarks of Microsoft Corporation.Progress is a registered trademark of Progress Software Corporation.All other product names are copyright and registered trademarks/tradenames of their respective owners.

Page 2: PerformanceTuningGuideSQL_803405

Table of ContentsIntroduction .................................................................................................................................3Stop and Restart AppServers .....................................................................................................3Verify Mfgsys.pf File Parameters ...............................................................................................4Update Schema Holder Settings ................................................................................................5# Blocks in DB Buffer ....................................................................................................................................5# Lock Table Entries .....................................................................................................................................5Spin Locks ....................................................................................................................................................6Background Writers ......................................................................................................................................6

Set the Schema Holder to Read Only .........................................................................................7Database Preparation ..................................................................................................................................7Define the Files as Read Only .......................................................................................................................7Edit the Mfgsys.pf File ...................................................................................................................................9Server Configuration File Recap .................................................................................................................10Open4 Optional Step ..................................................................................................................................10Troubleshooting – AppServer Error ............................................................................................................10

Disable Hyperthreading ............................................................................................................11Index Script for SQL Server 2005 .............................................................................................11Verify the Index Script is Run ......................................................................................................................11

Create a Table View ...................................................................................................................12Business Activity Query and SQL Issues ................................................................................12Server Permissions and Review ..............................................................................................13Network Bandwidth ...................................................................................................................13Hardware Upgrades ..................................................................................................................14Workstation Problems ..............................................................................................................14Additional Performance Troubleshooting ...............................................................................15System Troubleshooting .............................................................................................................................15Application Troubleshooting .......................................................................................................................15

Page 3: PerformanceTuningGuideSQL_803405

IntroductionThis document contains a series of instructions that can help you improve the performance of your SQL database. Each set of instructions documents a potential performance tuning option you can use. Implement the options which best match the configuration of your system. Each operating system and specific configuration is different, so the results of these options will vary.

Epicor recommends that you measure the performance benefits of these changes. To do this, time how long it takes to run a process before you use a performance option. Then after you implement the option, time the same process again. You should see a demonstratable savings in performance time.

Be sure to record each change and why you made it. You then can review what you did later on. Write comments in your scripts and .pf files to document the changes. Remember that you can gain a lot of performance by just doing a few things. Usually adding memory and spreading the disk workload across as many disks as possible gives you the best performance gains. Always stop after you have accomplished enough; the more tuning you do, the smaller the return on your investment.

Stop and Restart AppServersThroughout these instructions, you are frequently asked to stop and restart your AppServers. You must do this to activate your performance tuning changes.

Follow these instructions each time you are asked to stop and restart your AppServers:

1. From the desktop, click Start and navigate to the following program: Programs->Open Edge (10.0B or 10.1B)->Progress Explorer Tool

2. The Progress Explorer Tool is displayed. Review the left pane. A yellow gear labeled Progress Explorer appears; below this icon either localhost or the server physical name are displayed.

3. From the Actions menu, select the Connect… command.

Note: The Progress Explorer Tool can be set up to connect automatically. If this is the case with your application, skip steps 3 and 4.

4. Within the localhost Login window, enter your User Name and Password.

5. Click OK.

6. Several folders are displayed. Locate and expand the AppServer folder.

7. Each database contains three AppServers; locate the three AppServers for your database. Forexample: Mfgsys803, Mfgsys803ProcessServer, and Mfgsys803TaskAgent.

8. Right click on each AppServer. From the context menu, select Stop.

9. Wait until each AppServer displays the Not Running status.

Note: To view the status, click on the AppServer folder in the left pane. The current status of the AppServer displays in the right pane.

10. When they each stop, you must start them again. To do this, right click on each AppServer. From the context menu, select Start.

Each AppServer is now refreshed with your changes.

Performance Tuning Guide (SQL) Vista/Vantage 8.03.405 3

Page 4: PerformanceTuningGuideSQL_803405

Verify Mfgsys.pf File ParametersThe Mfgsys.pf file contains the parameters for the application database. For a SQL database, it controls the client connection to the database. The first line if this file must be correctly set up. You enter different parameters depending on your version of OpenEdge.

Follow these instructions to make sure the Mfgsys.pf file is correctly set up:

1. Launch Windows Explorer.2. Browse to: \Epicor\Mfgsys803\Server\Config3. Right-click the Mfgsys.pf file.

4. From the context menu, select Edit.Review the first line of code within the .pf file. Depending on your version of OpenEdge, the first line of this code must have the following parameters:

OpenEdge 10.0B:-Mm 1024 -mmax 65534 -Bt 4096 -s 8000 -yy 1970 -stsh 31 -inp 32000 -tok 4000 -TB 31 -TM 32 -D 500 -l 1000

OpenEdge 10.1B:-Mm 1024 -mmax 65534 -Bt 4096 -s 8000 -yy 1970 -stsh 31 -inp 32000 -tok 4000 -TB 31 -TM 32 -D 500 -l 1000-tmpbsize 8 -ttmarshal 5-T P:\AppserverTempFiles-db D:\Data\MfgSys803\db\Schemaholder\mfgsyssh -ld mfgsyssh -db MfgSys803403 -dt MSS -ld mfgsys -Dsrv PRGRS_CONNECT,DSN=MfgSys803403,TXN_ISOLATION,1,PRGRS_NATIVE_LOCKWAIT,60000

5. If any of these parameters are missing, enter them in the first line.

6. Save your changes.

These changes do not activate until the AppServers and the database are stopped and started within the Progress Explorer Tool. Review the previous Stop and Restart AppServers instructions to learn how to do this process.

Performance Tuning Guide (SQL) Vista/Vantage 8.03.405 4

Page 5: PerformanceTuningGuideSQL_803405

Update Schema Holder SettingsYou can adjust some schema holder settings depending on server resources, database size, and number of users. Follow these steps to update the options.

Note: If you decide to set the schema holder to read only, do not use these instructions. The schema holder must be able to receive data for the changes in this section to impact performance. To learn how to do this, review the Set the Schema Holder to Read Only section.

# Blocks in DB BufferFor the Progress schema holder, you only need a 10000 value for the # Blocks in DB Buffer parameter. To change this parameter:

1. Go to your application server.

2. Click Start and navigate to the following program: Programs->Open Edge (10.0B or 10.1B)->Progress Explorer Tool

3. Expand the Databases folder to display MfgSys803.

4. Expand the MfgSys803 folder to display Configurations and DefaultConfiguration.

5. Right-click DefaultConfiguration.

6. From the context menu and select Properties.7. Change the # Blocks in DB Buffer to a 10000 value.

8. Click OK.

# Lock Table EntriesThe # Lock Table Entries value defines how many record locks can be made to the data at any given time. This number can grow large while running large processes like MRP. Performance problems result when too many records are being accessed at the same time. If this occurs, you see this error message: Lock table overflow, increase –L on server (915).

To change this parameter:

1. Return to the DefaultConfiguration Properties window. If you need to navigate to this window, follow the instructions in the # Blocks in DB Buffer section.

2. Locate the #Lock Table Entries field.

3. Increase this numeric value to a 409600 value or higher. Progress recommends you enter a num-ber that is a multiple of 8192.

4. Click OK.

Performance Tuning Guide (SQL) Vista/Vantage 8.03.405 5

Page 6: PerformanceTuningGuideSQL_803405

Spin LocksSpin locks define the number of times a process tries to acquire a launch before it pauses. If the process cannot acquire the resource latch, it resets and attempts to acquire it again. This iterative process is called spinning.

To adjust the spin locks:

1. Return to the DefaultConfiguration Properties window. If you need to navigate to this window, follow the instructions in the # Blocks in DB Buffer section.

2. Go to the Advanced section.

3. Increase the Spin Locks Retries value. Progress recommends a value of 20000 per processor. If you use a dual/dual core CPU, increase this value to 800000.

4. Click OK.

Background WritersBackground writers are not used by the Progress Explorer Tool for a SQL database. If you turn them off, you free up some resources on the server.

1. Return to the DefaultConfiguration Properties window. If you need to navigate to this window, follow the instructions in the # Blocks in DB Buffer section.

2. Go to the Background Writers section.

3. Locate the #APW value; set it to start at 0.

4. Clear the Auto Startup check box on the before-image writer.

5. Clear the Auto Startup check box on the after-image writer.

6. Click OK.

These changes do not activate until the AppServers and the database are stopped and started within the Progress Explorer Tool. Review the previous Stop and Restart AppServers instructions to learn how to do this process.

Performance Tuning Guide (SQL) Vista/Vantage 8.03.405 6

Page 7: PerformanceTuningGuideSQL_803405

Set the Schema Holder to Read OnlyDuring this process, you set up either the Mfgsyssh 8.03.305 or 8.03.400 schema holder database to Read-Only (-RO); both items significantly improve performance.

Note: You can only do these steps on systems where the AppServers and the schema holder database are on the same machine. Do not follow these instructions on load balanced systems where the AppServers are on distributed servers.

Database Preparation1. Stop all the AppServers for the Mfgsys803 database.

2. Stop the Mfgsys803 database.

3. Click the Start button. Navigate to: Programs ‡ OpenEdge ‡ Proenv4. At the Proenv> prompt, enter the following: prompt5. Press Enter.6. Change the directory to the database folder for Mfgsys803. To do this, enter:

cd \epicor\mfgsys803\db7. Truncate the bi file. To do this, enter: proutil mfgsyssh –C truncate bi8. Close the Proenv window.

Define the Files as Read Only1. Launch Windows Explorer.2. Browse to: \Epicor\Mfgsys803\Db3. Highlight the Mfgsyssh.B1, Mfgsyssh.D1, and Mfgsyssh.DB files.

4. Right click on the selected files.

Performance Tuning Guide (SQL) Vista/Vantage 8.03.405 7

Page 8: PerformanceTuningGuideSQL_803405

5. From the context menu, select Properties.

6. Select the Read Only check box.

7. Click Apply and then click OK.

Performance Tuning Guide (SQL) Vista/Vantage 8.03.405 8

Page 9: PerformanceTuningGuideSQL_803405

Edit the Mfgsys.pf File1. Return to Windows Explorer.2. Browse to: \Epicor\Mfgsys803\Server\Config3. Right-click the Mfgsys.pf file.

4. From the context menu, select Edit.5. Enter a pound sign (#) in front of each current line:

#-Mm 1024 -mmax 65534 -Bt 8000 -s 200 -yy 1970 -stsh 31 -inp 32000 -tok 4000#-T D:\epicor\mfgwrk803#-db D:\epicor\mfgsys803\db\mfgsyssh#-db mfgsys803 -dt MSS -ld mfgsys -Dsrv PRGRS_CONNECT,DSN=MFGSYS803,TXN_ISOLATION,1

6. The pound signs comment out these lines, so they are no longer active. Now enter the following lines below the lines you commented out. The bold lines indicate where you need to enter any drive and path changes. Also note that you enter different lines, depending on whether you use 8.03.305 or 8.03.403 (or higher):

#8.03.305 -Mm 1024 -mmax 65534 -Bt 4096 -s 8000 -yy 1970 -stsh 31 -inp 32000 -tok 4000 -TB 31 -TM 32 -D 500 -l 1000-tmpbsize 8-T D:\epicor\mfgwrk803-db D:\Epicor\Mfgsys803\Db\mfgsyssh -ld mfgsyssh -RO-db mfgsys803 -dt MSS -ld mfgsys -Dsrv skip_schema_check,PRGRS_CONNECT,DSN=MFGSYS803,TXN_ISOLATION,1

#8.03.400 -Mm 1024 -mmax 65534 -Bt 4096 -s 8000 -yy 1970 -stsh 31 -inp 32000 -tok 4000 -TB 31 -TM 32 -D 500 -l 1000-tmpbsize 8 –ttmarshal 5-T D:\epicor\mfgwrk803-db D:\Epicor\Mfgsys803\Db\mfgsyssh -ld mfgsyssh -RO-db mfgsys803 -dt MSS -ld mfgsys -Dsrvskip_schema_check,PRGRS_CONNECT,DSN=MFGSYS803,TXN_ISOLATION,1,PRGRS_NATIVE_LOCKWAIT,60000

Note: If you use the 8.03.400 version, you need one additional parameter in the .pf file. Enter this parameter: -ttmarshal 5

7. Start the AppServers for the Mfgsys803 database. Do not, however, start the Mfgsys803 database itself.

This database no longer needs to run, improving performance.

Performance Tuning Guide (SQL) Vista/Vantage 8.03.405 9

Page 10: PerformanceTuningGuideSQL_803405

Server Configuration File RecapYour edited Mfgsys.pf file looks like this:

#-Mm 1024 -mmax 65534 -Bt 8000 -s 200 -yy 1970 -stsh 31 -inp 32000 -tok 4000#-T D:\epicor\mfgwrk803#-db D:\epicor\mfgsys803\db\mfgsyssh#-db mfgsys803 -dt MSS -ld mfgsys -Dsrv PRGRS_CONNECT,DSN=MFGSYS803,TXN_ISOLATION,1-Mm 1024 -mmax 65534 -Bt 4096 -s 8000 -yy 1970 -stsh 31 -inp 32000 -tok 4000 -TB 31 -TM 32 - D 500 -l 1000-tmpbsize 8-T D:\epicor\mfgwrk803-db D:\Epicor\Mfgsys803\Db\mfgsyssh -ld mfgsyssh -RO-db mfgsys803 -dt MSS -ld mfgsys -Dsrv skip_schema_check,PRGRS_CONNECT,DSN=MFGSYS803,TXN_ISOLATION,1 ,PRGRS_NATIVE_LOCKWAIT,60000

Open4 Optional StepIf you run Open4 on the same server, you must modify the Open4.pf file. You need to comment out the TCP/IP connection type and replace it with the physical path to the Mfgsyssh schema holder.

In the following example, the pound sign ( # ) comments out the TCP connection. Directly below this statement is the physical connection with the read only (RO) flag.

-Mm 1024 -mmax 4000 -Bt 200 -s 200 -yy 1970 -stsh 31 -inp 32000 -tok 4000 -rand 2-db o4db -N TCP -H Vantage -S 8088 -T d:\epicor\mfgwrk803#-db mfgsyssh -N TCP -H Vantage -S 8300-db D:\Epicor\Mfgsys803\Db\mfgsyssh -ld mfgsyssh -RO-db mfgsys803 -dt MSS -ld mfgsys -Dsrv PRGRS_CONNECT,DSN=MfgSys803,TXN_ISOLATION,1

Troubleshooting – AppServer ErrorWhen you set the scheme holder to read only (RO), you may receive the following error message in the AppServer log: Could not recognize argument: 5. (301)

This error is caused when a control character is accidentally placed in front of the -ttmarshal 5 parameter. Copying and pasting the contents of a .pf file into Notepad can cause this unnecessary character to appear. To correct this issue:

1. Open the Mfgsys.pf file.

2. Locate the –ttmarshal 5 switch.

3. Delete both the space and the –ttmarshal 5 switch.

4. Manually re-enter the -ttmarshal 5 switch.

Performance Tuning Guide (SQL) Vista/Vantage 8.03.405 10

Page 11: PerformanceTuningGuideSQL_803405

Disable HyperthreadingHyperthreading is not needed if SQL server is installed. You disable this feature through the BIOS on your computer. Before you disable hyperthreading, however, please review your server manual. The following instructions are only intended as a guide:

1. Reboot the server.

2. As you soon as you see an opening Windows video on your screen, press F2.

3. Select CPU Info.

4. Select Logical Processors.

5. To shut off hyperthreading, select the Disable check box next to the HyperThreading field.

6. Save the BIOS changes.

7. Restart the computer.

Index Script for SQL Server 2005If you are experiencing locking, poor performance, or MRP issues with your SQL database, Epicor recommends you run an index script. It changes the Progress_recid index to be non-clustered.

To use this script, you must run either the 8.03.305 or the 8.03.400 index script with SQL Server 2005.

1. If you want to improve MRP process performance, launch Process MRP.

2. Reduce the Number of MRP Processes. If you run Finite scheduling, reduce this value to 1.

3. Reduce the Number of Schedulers. If you run Finite scheduling, reduce this value to 1.

Note: MRP can have slow performance if several processes and schedulers are used compared to the available server capacity. More processes and schedulers do not always give you faster performance. If you are unable to complete an MRP process run and you use Infinite scheduling, the best way to test it is to start with Number of MRP Processes and Number of Schedulers both equal to 2.

4. Download the Script_instructions.doc file.

5. Download the appropriate index script kit, either Unique_index_305d.sql or Unique_index_4xx.sql.

6. Extract the .zip file contents to a folder you want.

7. Review the Script_instructions.doc file to learn how to run the process.

Verify the Index Script is RunYou can verify that the index script was run. To do this:

1. Launch SQL Server Management Studio.

2. Connect to the server.

3. In the Object Explorer, navigate to: Database > Mfgsys803 > Tables > dbo.AbcCode > Indexes4. Right-click on abccode#_#progress_recid.5. From the context menu, select Properties.

6. If the Unique check box is selected, the index script has not run.

Performance Tuning Guide (SQL) Vista/Vantage 8.03.405 11

Page 12: PerformanceTuningGuideSQL_803405

Create a Table ViewIf you experience performance problems while running custom or modified reports with an ODBC connection, consider creating a table view. Database tables may become locked while the report is run; the table view can bypass these SQL lock problems.

To correct this issue:

1. Create a view for each table that has an ODBC connection access. Do this by using a third party application like Crystal Reports, Excel, or another ODBC source.

2. Enter a “with (nolock)”3. Save the file.

Now anybody who accesses the modified table view cannot create a share lock within the SQL database, improving report performance.

Note: If you do not use a table view, you should instead use the “with (nolock)” option in the SELECT statement for the table.

Business Activity Query and SQL IssuesSQL function syntax is stricter than Progress syntax. If you previously ran the application using a Progress database but now have moved to SQL, you may experience these syntax issues.

The main issue is that you can use abbreviations within Progress; for example, ABSOLUTE can be abbreviated to ABS, ABSO, or ABSOL within Progress. BAQ formulas are directly sent to SQL. As long as these formulas do not contain any abbreviations, they work as expected. However if a formula references an abbreviation, syntax issues occur.

The following table displays the functions which are not identical between Progress and SQL. The characters contained between the parentheses are optional characters in Progress.

Progress SQL (Before Translation) SQL (After Translation)ABS(OLUTE) ABS absASC(II) ASC asciiINT(EGER) INTEGER convertMAX(IMUM) MAXIMUM dbo.maximum (user-defined

function)MIN(IMUM) MINIMUM dbo.minimum (user-defined

function)

Performance Tuning Guide (SQL) Vista/Vantage 8.03.405 12

Page 13: PerformanceTuningGuideSQL_803405

Server Permissions and ReviewEpicor recommends you use the following server permissions:

•Set the \Epicor folder to shared with full control for everyone.

•Set the \Mfgsysdata folder to shared with full control for everyone.

•Set the NTFS permissions to read only (RO).

•Add the administrator.

•Verfy that the 8.03.400 databases are set to SQL 2005 mode.

•Optionally, you can gain performance by removing mfgsysdata, Client 803, all .mdf files, and all .ldf files from anti-virus scanning.

Network BandwidthEach network has a bandwidth that defines how much data can be transferred across it at the same time. If the network bandwidth is too small to handle the data that must be transferred, performance is reduced. This typically happens when too many users are logged into a single network segment. If you have slow network performance, either consider lowering the amount of network traffic or increasing the bandwidth of the network itself.

Traditional network hubs are gradually being replaced by high-speed data switches; this hardware is slowly alleviating network bottlenecks over the Internet. To increase the bandwidth of your company network, however, consider adding multiple server network cards and automated load balancing to your overall network configuration.

Note: Diagnosing a network bandwidth issue is difficult. If you are not comfortable working with the network, contact a professional network analyst.

As a general rule, the Epicor client requires a bandwidth of 56 - 500 kilobytes per second (kbps). This requirement varies based on the volume of data that transfers between each client and the server. To calculate the amount of bandwidth you need, determine the worst kbps bandwidth throughput for each client and then divide that amount into the total network segment bandwidth.

For example, if each client needs at least 1.5 mbps of bandwidth and the network has 100 mbps, the network segment should support 66 client machines.

This calculation is only meant as a starting point for the maximum number of clients per network segment. It does not consider the media characteristics of your network, which could potentially affect the number of clients the network segment can support.

For more information on this subject, review this web article:

http://mediaproducts.gartner.com/reprints/juniper/vol3/article2/article2.html

Performance Tuning Guide (SQL) Vista/Vantage 8.03.405 13

Page 14: PerformanceTuningGuideSQL_803405

Hardware UpgradesBy default, SQL Sever self-tunes. When more hardware resources are added to the server, SQL automatically tunes itself to accomodate the new hardware.

Workstation ProblemsIf you experience workstation problems, like locking up and display issues, do the following:

1. Log out of Vista or Vantage.

2. Right-click the Start button.

3. From the context menu, select Explorer.4. Navigate to this path: C:\Documents and Settings\All Users\Application Data\Epicor\Vantage

or Vista5. Delete all the version folders that exist below Vista or Vantage.

6. Log back into Vista or Vantage.

Performance Tuning Guide (SQL) Vista/Vantage 8.03.405 14

Page 15: PerformanceTuningGuideSQL_803405

Additional Performance TroubleshootingThe previous sections of this guide detail specific options you can use to improve the performance of your SQL Server. This section provides a different category of information; it documents actions you can take to reduce poor performance within both your overall system and the application.

System Troubleshooting•If the Microsoft XP firewall is active, it may slow performance. Test this firewall against other firewall options to discover which one reduces performance the least but still effectively protects your system.

•Frequent virus scans on the Mfgsysdata and the client folders slows performance. Schedule virus scans during off hours.

•Backing up the database during the day slows performance. Schedule database backups during off hours.

•Avoid directly accessing tables through ODBC or SQL Explorer. If you do this, records can lock-up.

•Avoid setting the DSN value to the wrong default isolation level within ODBC. If you do this, records can lock up.

Application Troubleshooting•Be sure to disable all schedules before you move from the training database to your live database. If you do not, two MRP processes run at the same time, slowing down performance.

•Epicor recommends that you do not run MRP processing during the work day. Schedule MRP pro-cessing during off hours.

•Be sure that your Business Activity Queries (BAQs) are properly written. If a BAQ pulls unnecessary data or a calculation is improperly constructed, each time this BAQ is run it slows performance.

•Avoid creating several Business Process Management (BPM) procedures that generate email mes-sages at the same time (synchronously). If these procedures run frequently, performance is reduced. Instead, set up your BPM procedures to run asynchronously.

•Avoid activating too many change logs within the Business Activity Manager. Only run change logs for the specific fields you need. When too many logs are running, they slow performance.

•Performance slows when several large reports generate at the same time. To resolve this, move your report generation processes to separate AppServers.

•Likewise, when multiple applications run at the same time, performance slows. Try to only use the programs you need when you need them. Close them if they are no longer active.

Performance Tuning Guide (SQL) Vista/Vantage 8.03.405 15