惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Troy Hunt's Blog
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
F
Full Disclosure
Recorded Future
Recorded Future
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
博客园_首页
博客园 - 叶小钗
MongoDB | Blog
MongoDB | Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Hacker News: Front Page
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
博客园 - 司徒正美
Webroot Blog
Webroot Blog
Google DeepMind News
Google DeepMind News
Help Net Security
Help Net Security
Cloudbric
Cloudbric
PCI Perspectives
PCI Perspectives
有赞技术团队
有赞技术团队
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
TaoSecurity Blog
TaoSecurity Blog
L
Lohrmann on Cybersecurity
量子位
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tailwind CSS Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
P
Proofpoint News Feed
N
News and Events Feed by Topic
罗磊的独立博客
T
Threat Research - Cisco Blogs
Schneier on Security
Schneier on Security
T
Tor Project blog
IT之家
IT之家
M
MIT News - Artificial intelligence
S
Security @ Cisco Blogs
O
OpenAI News
AI
AI
S
Securelist
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
月光博客
月光博客
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 热门话题

博客园 - MSSQL123

ubuntu24下 ext4和xfs类型磁盘以及PostgreSQL实例性能对比测试 PostgreSQL 18 新特性 skip scan,一个鸡肋的功能 PostgreSQL 17 流复制中开启逻辑复制槽同步,以及逻辑槽的故障转移 记一次PostgreSQL交叉表crosstab行转列导致的OOM TiDB 扩容与缩容 PostgreSQL 高可用集群 patroni 自动故障转移测试 Ubuntu 20 环境下 patroni 自动化安装,一分钟快速搭建 patroni 集群 Ubuntu 20 环境下 pg_auto_failover 自动化安装,一分钟快速搭建pg_auto_failover集群 PostgreSQL的消息队列扩展pgmq 磁盘IO延迟和队列深度的关系 TiDB 最小拓扑架构集群安装 PostgreSQL 逻辑复制中的同步和异步模式以及其表现 prometheus 的 altermanager Silences静默告警,优雅地抑制告警 “世界上百分之99的博士和他们的论文都是垃圾”,原本以为这个观点偏激 pg_auto_failover 在多种场景下自动故障转移的验证 pgbouncer连接池设置与压力测试的最大连接数测试 pg_auto_failover 自动故障转移参数 博文阅读密码验证 - 博客园 pg_auto_failover 高可用中,PostgreSQL实例配置文件的加载步骤 pg_auto_failover集群monitor节点的高可用 prometheus监控Linux Server node_exporter代理安装和配置 prometheus监控windows window_exporter代理安装和配置 Prometheus 和 Grafana 监控 PostgreSQL 记一次MySQL binlog日志导致磁盘空间占满的问题 Windows Failover Cluster集群中的EventId 1196错误日志 pg_auto_failover 环境变量导致的show命令错误 SqlServer 事务复制(transaction replication)的复制位点信息 SqlServer 事务复制的两个参数immediate_sync,allow_anonymous MySQL,SqlServer,PostgreSQL中,如何实现锁定一张表 PostgreSQL pg_auto_failover 高可用 2:pg_auto_failover集群运维 PostgreSQL pg_auto_failover 高可用 1:pg_auto_failover集群搭建 PostgreSQL patroni 高可用 4:HAProxy和Keepalived实现读写分离 PostgreSQL patroni 高可用 3:patroni 运维
SQLServer 2019 标准版在虚拟机上无法充分利用CPU的问题诊断
MSSQL123 · 2025-12-12 · via 博客园 - MSSQL123

最近发现一台SQLServer服务器CPU使用率中,有4个CPU心很繁忙,6个CPU核心却很空闲,由于是SQLServer 2019标准版,猜测到可能是跟虚拟机的CPU授权数有关。

这台机器是笔者从Infrastructure部门接到的干净的虚拟机,然后自己安装的数据库,数据库本身没有对CPU有任何限制,当时并没有注意这个细节,从任务管理器中可以看到虚拟机的CPU是10个逻辑核心(processer)对应10个socket(针脚),也就是在创建虚拟机的时候,以多个每个socket 1 个核心的方式分配的CPU资源

image

CPU资源分配方式大概类似如下:从ESXi控制台中看,分配CPU的时候,有两个因素,总的CPU核心数,以及每个Socket的核心数。个人猜测当时创建虚拟机的Infrastructure部门同事认为这样效率更高,虚拟机的CPU,从多个物理CPU每个CPU贡献1个核心的方式,这种方式跟分配1个Socket的10个核心,同样都是10个CPU核心的虚拟机,对于SQLServer来说,可以是天差地别的。

image

参考微软官方的文档中的说明,对于标准版的SQLServer,最多可以使用4个Socket或者32个核心,以两者中的下线为准,也就是说,10个Socket10核心的CPU,即便10个CPU没有超出32,但是Socket的上限4,这种情况下也只能使用4个CPU

https://learn.microsoft.com/en-us/sql/sql-server/compute-capacity-limits-by-edition-of-sql-server?view=sql-server-ver15

image

然后检查SQLServer启动日志,果不其然,中间有一条提醒:
SQLServer detected 10 sockets with 1 cores per scokect and 1 logical processers  per socket, 10 total logical processers; using4 logical processers based on SQL Server licensing. 
这就说明了一开始的现象:有4个CPU心很繁忙,6个CPU核心却很空闲,实际上SQLServer服务仅使用了4个CPU,其他6个CPU资源因为licensing的原因并没有使用到。

image

SQLServer标准版对于CPU的使用,受限于“Limited to lesser of 4 sockets or 32 cores”,因此在创建虚拟机分配CPU资源的时候,一定要了解到这个规则,不要超过4个Sockets,否则Socket超出4的CPU无法利用。