Try   HackMD
tags: 資料庫 Sql MSSQL

MSSQL使用指令測試Server硬碟速度小技巧

讀取速度

選抽一個資料庫 下BACKUP DATABASE指令,備分資料庫不做寫入,只做讀取,可得到讀取速度值。

BACKUP DATABASE [FUXIN_CPL] TO DISK ='NULL' WITH COPY_ONLY

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

下圖可看到結果每秒讀取速度為180MB/sec

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

寫入速度

BACKUP DATABASE [FUXIN_CPL] TO DISK ='C:\TEST.BAK' WITH COPY_ONLY

此時會得到讀寫時間為每秒153MB

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

每秒153MB為讀寫時間,此時須作運算處裡將寫入時間算出

讀取總頁數共688頁,一頁8k => 688*8.0 / 1024 = 5.375M

寫入時間為 0.035-0.03 = 0.005

5.375M/0.005 = 1075M