iT邦幫忙

0

SQL Server VM 常見的 CPU 設定問題 - 心得分享

DBA Bootcamp

前一陣子,發現一台 SQL Server 的 compute 效能好像不如預期的好。仔細檢查一下,發現這一個 SQL Server VM 有 8 個 cores, 但是 SQL Server 好像都只用了一半 CPU 的 compute power. 用 select @@version 指令查看安裝的 SQL Server 版本,結果是 Standard Edition。到此,幾乎可以斷定問題的所在了。

進一步檢查 VM 的 CPU 設定為 8 sockets with single core (8 x 1 = 8 cores). 但是 SQL Server Standard Edition 的限制是最多只能使用 4 sockets. 所以,在這種情況下,只能使用最前面的 4 sockets with single core (4 x 1 = 4 cores)。這也就是為什麼資料庫效能好像只用了一半的 CPU power.

那要怎麼樣才能使用到全部 8 cores 的 power 呢? 解決辦法很簡單。只要把 VM 的 CPU 設定從…
8 sockets with single core (8 x 1 = 8 cores)
改成…
4 socket with dual-core (4 x 2 = 8 cores)
或是
2 sockets with quad-core (2 x 4 = 8 cores)
就可以了。

附加說明: 另外一個簡單的檢測方法是查看 SQL Server 的 log。如果設定錯誤的話,會看到如下的警示訊息…

SQL Server detected 8 sockets with 1 cores per socket and 1 logical processors per socket, 8 total logical processors; using 4 logical processors based on SQL Server licensing. This is an informational message; no user action is required.


圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言