MS SQL Layout for best performance
Solution 1:
I'd put the OS, paging file and LDF(s) on the RAID1 array. Everything else on the RAID10 array.
If you're not using Windows 2008 make sure your partitions are correctly aligned:
http://msdn.microsoft.com/en-us/library/dd758814.aspx
As already explained add 1 TEMPDB file per cpu core - make them all the same size.
Size your log files appropriately and create them in one step.
Consider backing up your databases to a different server over a network share if possible - to mitigate the risk of your array completely failing and taking your database and backups with it.
Solution 2:
TempDB
I did some research a while ago about tempdb optimization and answered my own question on Stackoverflow. Here is what I found out.
In order to optimize tempdb performance pay attention to physical disk configuration, file configuration, as well as some settings within the database.
Physical disk configuration
tempdb should reside on its own dedicated physical disks. This allows it to split I/O transactions from the remainder of volumes on the SQL Server.
To move tempdb to a new disk drive, use ALTER DATABASE
. It is the key T-SQL command to perform this operation. Microsoft offers a good example in SQL Server 2005 Books Online. The article name is ALTER DATABASE (Transact-SQL) and the specific section is 'G. Moving tempdb to a new location.'
The tempdb is a very high-write database. So, a RAID 5 array isn't the proper place for it. You should put the tempdb on either a RAID 1 or RAID 10 array as they're optimized for high-write applications. If you can afford additional RAID 1 or RAID 10 arrays for each physical database file for the tempdb, you'll get increased performance.
Database files
You should have one physical file per CPU core in the server. So, if you have a dual-chip, dual-core server, you should have four physical database files for the tempdb database. When adding more database files, it's important to configure the files at the same initial size and with the same growth settings. That way, SQL Server will write the data across the files as evenly as possible.
Database file size
The size of the tempdb database can affect the performance of a system. For example, if the size that is defined for tempdb is too small, part of the system-processing load may be taken up with autogrowing tempdb to the size required to support the workload every time you restart the instance of SQL Server. You can avoid this overhead by increasing the sizes of the tempdb data and log file.
Determining the appropriate size for tempdb in a production environment depends on many factors including the existing workload and the SQL Server features that are used. Microsoft recommends that you analyze the existing workload by performing the following tasks in a SQL Server test environment:
- Set autogrow on for tempdb (in a test environment!).
- Execute individual queries or workload trace files and monitor tempdb space use.
- Execute index maintenance operations, such as rebuilding indexes and monitor tempdb space.
- Use the space-use values from the previous steps to predict your total workload usage; adjust this value for projected concurrent activity, and then set the size of tempdb accordingly.
Minimum size recommendations for tempdb are as follows:
Envir. Size DB Size (MB) Log Size (MB) ----------- ------------ ----------- Small 1024 256 Medium 5120 1024 Large 10024 2048
Database settings
You can further increase tempdb performance by disabling the auto update stats, which will save your tempdb some work. You can also set the auto create statistics option to false.
Disclaimer: Settings should be changed with care. Depending on the kind of load you place on your tempdb, changing settings could adversely impact system performance.
To achieve optimal tempdb performance, follow the guidelines and recommendations provided in Optimizing tempdb Performance.
How to monitor tempdb usage?
Running out of disk space in tempdb can cause significant disruptions in the SQL Server production environment and can prevent applications that are running from completing operations.
You can use the sys.dm_db_file_space_usage
dynamic management view to monitor the disk space that is used by these features in the tempdb files. Additionally, to monitor the page allocation or deallocation activity in tempdb at the session or task level, you can use the sys.dm_db_session_space_usage
and sys.dm_db_task_space_usage
dynamic management views.
These views can be used to identify large queries, temporary tables, or table variables that are using lots of tempdb disk space. There are also several counters that can be used to monitor the free space that is available in tempdb and also the resources that are using tempdb.
Links:
- Microsoft Technet: Working with tempdb in SQL Server 2005
- SearchSQLServer.com: SQL Server tempdb best practices increase performance
- MSDN library: Optimizing tempdb Performance
- SearchSQLServer.com: Configure SQL Server 2005 TempDB for performance
- MSDN library: Capacity Planning for tempdb
- MSDN library: Troubleshooting Insufficient Disk Space in tempdb
Solution 3:
The easy generic answer is anything that involves high IO should go onto the the RAID 10 disk group. Also have you decided your partition strategy or that part of the question?
So in you first disk group I would probably create a single partition (about 70GB usable) I would place the OS and the MSSQL application on this.
On the second I would create the following partitions
1) partition for page file (dependant on much memory you have but about 10-20GB 2) partition for transaction log files 100GB 3) partition for Datafiles 100GB
This will leave you about 50GB spare that I would leave unassigned so you can grow either the log partition or the data one into as your requirements change.
Interestingly I am currently working on the very same spec machine only I am using Linux and Oracle, are you me from parallel universe?
James
Solution 4:
There have been some great answers so far, so I won't bother putting one up, but I'll pose a question to you.
Why didn't you ask this question before buying the server? Why are you trying to cram a system into an already purchased server instead of buying a server to fit the needs of the system?