Sql-server – Reducing the I/O in a drive

sql server

I have a drive named J drive, where all temp db files(log and data files), main database log files and another database log and data files(which holds intermediate processing tables) exist.This drive has 1.5 TB space, and above mentioned files occupy 1.2 TB space and fluctuates extremely(as it contains log and temporary processing tables).

Main db database files(primary and secondary) exist on another drive( K drive) which has 2 TB space, and occupy around 1 TB space.

J drive has high I/O, as a lot of calculations and processing exist in our DB.
I am planning to separate data and log files for each DB (Main DB,Temp DB and temp_data_processing db ) to J and K drive to reduce I/O.Will it help reduce I/O in the drives ?

Will it be better to add another drive ( e.g., P drive) and place temp DB log and data files in that drive ?

Thanks in advance for your kind reply !!!

Best Answer

Yes, separating data files and logs files will help to reduce I/O. The best practices for SQL Server are separated log, data, temp, backup files on several disks. Example :

  • data db files (.mdf) : drive D
  • log db files (.ldf) : drive L
  • tempDB files (.mdf & .ldf) : drive T
  • backup files (.bak) : drive B

You can also improve performances by separating tempDB in x differents files (on x differents drives) where x is the number of your CPU cores. Use SSD drives for tempDB files and db log files. Put indexes in different file on another drive.

Be aware that if you're using virtualized environment you need physically separated disks, or where your vdisks have fixed IOPs throttles vdisks with their own IOPs quota, to have full advantage.

Placing both data AND log files on the same device can cause contention for that device, resulting in poor performance. Placing the files on separate drives allows the I/O activity to occur at the same time for both the data and log files.

https://docs.microsoft.com/en-us/sql/relational-databases/policy-based-management/place-data-and-log-files-on-separate-drives?view=sql-server-2017

https://searchsqlserver.techtarget.com/tip/Optimize-disk-configuration-in-SQL-Server

Don't forget to perform maintenance tasks as rebuild/reorganise indexes...