dbi services Blog
Welcome to the dbi services Blog! This IT blog focuses on database, middleware, and OS technologies such as Oracle, Microsoft SQL Server & SharePoint, EMC Documentum, MySQL, PostgreSQL, Sybase, Unix/Linux, etc. The dbi services blog represents the view of our consultants, not necessarily that of dbi services. Feel free to comment on our blog postings.
Improving your SharePoint performance using SQL Server settings (part 1)
SharePoint performance is a recursive problem and preoccupation. As a Database Administrator, we have to deal with SharePoint when configuring SQL Server databases.
In this article, I will propose a list of best practices in SQL Server settings aimed to reduce SharePoint performance issues.
This article is inspired from the presentation Optimizing SQL Server for Speedy SharePoint by Sahil Malik held at the European SharePoint Conference 2014 in Barcelona.
Do not keep the default value which is 1 MB. We can illustrate with a simple example why this is a bad idea.
When a document of 5 MB is uploaded, it means there are 5 Autogrowth which are activated. In fact, there are 5 allocations of space which must slow your system.
Moreover, your uploaded document will be fragmented across your different data files. This configuration will decrease your performance a second time.
To avoid performance issues and reduce fragmented data files, you should set the autogrowth value to a fixed number of megabytes.
My recommendation is 1024 MB for data files and 256 MB for log files. But keep in mind, this is a global recommendation. In fact, the bigger the database, the bigger the growth increment should be.
SQL Server disk cluster size
The default value of SQL Server is 4 KB. But in fact, it is nearly the worst value you can choose for this configuration!
Globally, 64 KB is a safe value. Indeed, the server reads 64 KB at the time and can deliver larger chunks of data to the SQL Server database.
First, the TempDB recovery model should be set to simple. Indeed, this model automatically reclaims log space to keep space requirements small.
Also, you should put your TempDB on the fastest disks you have, because TempDB is heavily used by SharePoint. Do not let SQL Server use this disk for any other needs, except TempDB utilization!
Furthermore, each TempDB file should be 25% larger than the largest content database. Not many DBAs realize how a TempDB is used by SharePoint and to what extent a TempDB can grow!
WSS_Content database, for example, is used to store site collection as well as lists and its tables are shared. Therefore, indexes are very important!
So do not forget to manage the fragmentation of your databases.
My recommendation is to perform a Reorganize when your fragmentation is between 10% and 30 % as well as a Rebuild index when your fragmentation is above 30%.
Take care about indexes with more than 1’000 pages!
Do not enable Auto-Create Statistics on an SQL Server that supports SharePoint Server! Let SharePoint Server configure the required settings alone.
Auto-Create Statistics can significantly change the execution plan of a query from one instance of SQL Server to another.
Therefore, do not enable Auto-Update Statistics and use instead SharePoint Auto-Update capability instead.
SQL Server Memory Allocation
The default values of SQL Server for memory allocation are 0 MB for Minimum server memory and 2147483647 MB for Maximum server memory.
The default value of the Maximum server memory is not optimized at all!
You should set a custom value depending on the total amount of physical memory, the number of processors, and the number of cores.
To calculate your SQL Max Memory, I suggest you to read this article.
Be aware that items in the recycle Bin may affect the performance.
Moreover, after a certain limit of days or after a deletion, these items are moved to a second stage recycle bin that may also affect your performance.
As a result, you have to manage your recycle bin depending on your needs to ensure that the size of your recycle bin will not continue to grow out of control.
The default value of your MAXDOP is 0. But for better performance, you should make sure that a single SQL Server process serves each request.
Therefore, you must set MAXDOP to 1.
The default value is 0, which is equal to 100. It means that you do not provide space for index expansion.
But when a new row is added to a full index page, the Database Engine make a reorganization called Page Split.
Page Split can take time to perform, and can cause fragmentation increasing I/O operations.
I recommend to set a Fill Factor value of 70. It means that 30 % of each-level page will be left empty.
Therefore, you can support growth and reduce fragmentation.
Instant File initialization
This feature, when enabled, allows SQL Server to initialize database files instantly, without physically zeroing out each and every 8K page in the file.
Therefore, depending on the size of files you have, you can save a lots of time.
The default settings of the content database in SQL Server are pretty bad and far from what we really need. You should always opt for a pre-allocate size strategy and not rely on autogrowth.
Monitoring your databases for space and growth to avoid bad surprises is very important.
Also, do not forget to modify your model database for size allocation rules.
Ans if you do not want to suffer from bad performances, do not use the Auto-Shrink capability.