Faisal
Faisal

Reputation: 4264

Bandwidth throttling with SQL Server database

In one of our application (that runs as windows service written in .Net), there are huge number of BLOB read/write requests. Our client wants process to be configured in such a way that it runs at full speed during the off hours while during the peak hours, it runs at lets say 1 MB per second.

What is the better way to read and write BLOBs to database at throttled speed? And is it recommended at all to write BLOBs to database in chunks that may take one insert statement to be completed in few minutes depending on the size of BLOB?

Any suggestions?

Upvotes: 0

Views: 1268

Answers (1)

Remus Rusanu
Remus Rusanu

Reputation: 294387

Are you using BLOB streaming access semantics? You must, see Download and Upload images from SQL Server via ASP.Net MVC for an example (you can adapt it from ASP/MVC to any other technology, the important part is the streaming in and out of the BLOBs).

Now back to your question: the last thing you want to do is to throttle the speed at which BLOBs are read or write. Writing and reading acquire locks and you do not want to keep the lock for even a millisecond more than you absolutely must. So instead of asking how to throttle the reads and writes, ask how to throttle the number of reads and writes. And that is entirely up to you, simple throttle the requests processed in your .Net service.

Upvotes: 3

Related Questions