Hi @rodrag ,
what is the size for the sync IO, is it 8K as per standard or varies based on data read/transaction write/or lazy writes or checkpoint activities?
Based on read/transaction write or layzy writes or checkpoint activities.
Firstly, let's summarize the main disk read and write behavior of SQL Server.
For SELECT operations, as long as the data is cached in memory, there should not be any hard disk reads and writes (ideally)
SQL Server is basically a read-only data file. The amount of reading is directly related to the cache capacity of the memory, and it is also related to the amount of data that users need to read.
The writing of SQL Server is divided into two parts, the data file and the log file. The number of data file writes is mainly related to the amount of data modification, and Lazy Writer is also related to whether the memory is under pressure. The number of log files written is completely determined by the amount of data modification, and has nothing to do with whether the memory is under pressure. You can roughly think that the log file is Write Through.
So in a more general sense, the number of reads in SQL Server is directly related to whether the memory is under pressure. The less the memory is under pressure, the less the number of reads will be (note that it is not writing, this is very important, and many people have such a misunderstanding). The number of writes in SQL Server is directly related to the amount of data modification that the user has completed. If most operations of a database are queries, the write operations of SQL Server will be very few. This has nothing to do with memory pressure.
Next, let us take a look at what factors affect the behavior of SQL Server I/O operations:
1.SQL Server Recovery Interval (sp_configure)
Recovery Interval controls how often SQL Server performs a checkpoint. With the same amount of modification, if SQL Server frequently does checkpoints, the hard disk writes generated by each checkpoint will not be too much, and the impact on the hard disk will not be too great. If checkpoint is done only after a relatively long period of time, when the checkpoint is not done, SQL Server does not have hard disk writes, and the performance may be faster. But when doing Checkpoint, because a large number of changes have been accumulated, a large number of writes may be generated. At this point in time, the performance of SQL Server may be affected. So extending the checkpoint interval is not necessarily a good thing. On most SQL Servers, the default setting is better, and there is no need to modify it.
2.Automatic growth and automatic shrinkage of data/log files
The growth and shrinkage of the file will have a serious impact on the speed of SQL Server reading and writing to this file. Therefore, for a production database, automatic growth and automatic shrinkage should be avoided.
3.The degree of page fragmentation in the data file
SQL Server's operations on data are based on pages as the smallest unit. If the page is fragmented and each page does not store much data, then SQL Server may need to read and write many more pages. This will cause additional hard disk reads and writes.
BR,
Mia
If the answer is helpful, please click "Accept Answer" and upvote it.