I was doing a load test by sending the same web request 5000 times one after the other. Here are the total data transfer amounts I observed:
From SQL Server to SAN: 6 MB
From SAN back to SQL Server: 1.5 MB
From SQL Server back to IIS Server: 71 MB
And here are the mdf and ldf file size changes in full recovery mode:
mdf size increase: 1 MB
ldf size increase: 4 MB
As you can notice, despite the 71 MB returned to IIS Server, the total data from SAN to SQL Server was 1.5 MB. After doing some research, I figured that this was due to the SQL Server caching data and not hitting the disk for each request.
So, in order to disable this behavior, I used CHECKPOINT; DBCC DROPCLEANBUFFERS;
after each request. Here are the results after this change:
From SQL Server to SAN: 390 MB
From SAN back to SQL Server: 11 GB
From SQL Server back to IIS Server: 71 MB
mdf size increase: 1 MB
ldf size increase: 30 MB
My questions are:
1. What is the reason that data transfer from SQL Server to SAN increased from 6 MB to 390 MB? Shouldn't disabling caching have only affected reading from the disk, not writing to it?
2. Data from SAN to SQL Server became 11 GB. Is this a better indicator of the production environment rather than the 1.5 MB?
3. Data from SAN to SQL Server became 11 GB. And I wonder why SQL Server needs to fetch that much data from disk even though it is only returning 71 MB back to the IIS Server. Since I am using appropriate indexes, I assume SQL Server shouldn't be caching a lot of pages.
4. ldf size increase in cache disabled case is almost 8 times the increase in the cached case. Why is this?