<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://www.simcentric.com/sc/"},{"@type":"ListItem","position":2,"name":"KVM与独立服务器：技术深度解析","item":"https://www.simcentric.com/sc/hong-kong-dedicated-server-sc/kvm-vs-dedicated-servers-a-technical-deep-dive/"}]}</script> {"id":18238,"date":"2024-10-31T12:23:56","date_gmt":"2024-10-31T04:23:56","guid":{"rendered":"https:\/\/www.simcentric.com\/uncategorized-sc\/kvm-vs-dedicated-servers-a-technical-deep-dive\/"},"modified":"2024-10-31T12:28:53","modified_gmt":"2024-10-31T04:28:53","slug":"kvm-vs-dedicated-servers-a-technical-deep-dive","status":"publish","type":"post","link":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/kvm-vs-dedicated-servers-a-technical-deep-dive\/","title":{"rendered":"KVM\u4e0e\u72ec\u7acb\u670d\u52a1\u5668\uff1a\u6280\u672f\u6df1\u5ea6\u89e3\u6790"},"content":{"rendered":"<p>\u5728\u4e0d\u65ad\u53d1\u5c55\u7684\u670d\u52a1\u5668\u57fa\u7840\u8bbe\u65bd\u9886\u57df\u4e2d\uff0c\u5728KVM\uff08\u57fa\u4e8e\u5185\u6838\u7684\u865a\u62df\u673a\uff09\u548c<a href=\"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-optimize-over-provisioned-dedicated-server-resources\/\" target=\"_blank\" rel=\"noopener\">\u72ec\u7acb\u670d\u52a1\u5668<\/a>\u4e4b\u95f4\u505a\u51fa\u9009\u62e9\uff0c\u5bf9\u5bfb\u6c42<a href=\"https:\/\/www.simcentric.com\/sc\/products\/dedicated-server-hk\/\" target=\"_blank\" rel=\"noopener\">\u6700\u4f73\u670d\u52a1\u5668\u79df\u7528\u89e3\u51b3\u65b9\u6848<\/a>\u7684IT\u4e13\u4e1a\u4eba\u5458\u6765\u8bf4\u662f\u4e00\u4e2a\u5173\u952e\u51b3\u7b56\u3002\u672c\u6280\u672f\u5206\u6790\u6df1\u5165\u63a2\u8ba8\u4e86\u8fd9\u4e24\u79cd\u670d\u52a1\u5668\u7c7b\u578b\u5728\u9999\u6e2f\u52a8\u6001\u670d\u52a1\u5668\u79df\u7528\u73af\u5883\u4e2d\u7684\u67b6\u6784\u5dee\u5f02\u3001\u6027\u80fd\u6307\u6807\u548c\u5b9e\u9645\u5e94\u7528\u3002<\/p>\n<h2><strong>\u7406\u89e3KVM\u67b6\u6784<\/strong><\/h2>\n<p>KVM\u4f5c\u4e3a\u96c6\u6210\u5230Linux\u5185\u6838\u4e2d\u76841\u578b\u865a\u62df\u673a\u76d1\u63a7\u7a0b\u5e8f\uff0c\u5c06Linux\u5185\u6838\u8f6c\u53d8\u4e3a\u88f8\u673a\u865a\u62df\u673a\u76d1\u63a7\u7a0b\u5e8f\u3002\u901a\u8fc7\u865a\u62df\u5316\u6269\u5c55\uff08Intel VT-x\u6216AMD-V\uff09\uff0c\u8fd9\u79cd\u67b6\u6784\u80fd\u591f\u76f4\u63a5\u8bbf\u95ee\u786c\u4ef6\uff0c\u4e0e\u4f20\u7edf\u7684\u865a\u62df\u79c1\u6709\u670d\u52a1\u5668\uff08VPS\uff09\u76f8\u6bd4\uff0c\u663e\u8457\u964d\u4f4e\u4e86\u865a\u62df\u5316\u5f00\u9500\u3002<\/p>\n<pre><code>\r\n# \u5728Linux\u4e0a\u68c0\u67e5KVM\u652f\u6301\u7684\u793a\u4f8b\r\negrep -c '(vmx|svm)' \/proc\/cpuinfo\r\n\r\n# \u57fa\u672cKVM\u521b\u5efa\u547d\u4ee4\r\nvirt-install \\\r\n  --name=instance1 \\\r\n  --vcpus=2 \\\r\n  --memory=2048 \\\r\n  --disk path=\/var\/lib\/libvirt\/images\/instance1.qcow2,size=20 \\\r\n  --os-type=linux \\\r\n  --network bridge=br0\r\n<\/code><\/pre>\n<p>\u6211\u4eec\u7684\u57fa\u51c6\u6d4b\u8bd5\u7ed3\u679c\u663e\u793a\u4e86KVM\u548c\u72ec\u7acb\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u663e\u8457\u6027\u80fd\u7279\u5f81\uff1a<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr style=\"border: 1px solid #ddd;\">\n<th style=\"border: 1px solid #ddd; padding: 8px; text-align: left;\">\u6307\u6807<\/th>\n<th style=\"border: 1px solid #ddd; padding: 8px; text-align: left;\">KVM\u670d\u52a1\u5668<\/th>\n<th style=\"border: 1px solid #ddd; padding: 8px; text-align: left;\">\u72ec\u7acb\u670d\u52a1\u5668<\/th>\n<\/tr>\n<tr style=\"border: 1px solid #ddd;\">\n<td style=\"border: 1px solid #ddd; padding: 8px;\">CPU\u8fd0\u7b97\/\u79d2<\/td>\n<td style=\"border: 1px solid #ddd; padding: 8px;\">\u7ea6\u4e3a\u88f8\u673a\u768495%<\/td>\n<td style=\"border: 1px solid #ddd; padding: 8px;\">100%\uff08\u57fa\u51c6\uff09<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #ddd;\">\n<td style=\"border: 1px solid #ddd; padding: 8px;\">\u5185\u5b58\u5ef6\u8fdf<\/td>\n<td style=\"border: 1px solid #ddd; padding: 8px;\">\u989d\u59162-5%\u5f00\u9500<\/td>\n<td style=\"border: 1px solid #ddd; padding: 8px;\">\u539f\u751f\u901f\u5ea6<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #ddd;\">\n<td style=\"border: 1px solid #ddd; padding: 8px;\">I\/O\u6027\u80fd<\/td>\n<td style=\"border: 1px solid #ddd; padding: 8px;\">\u88f8\u673a\u768485-90%<\/td>\n<td style=\"border: 1px solid #ddd; padding: 8px;\">\u5b8c\u6574\u786c\u4ef6\u901f\u5ea6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><strong>\u8d44\u6e90\u7ba1\u7406\u548c\u53ef\u6269\u5c55\u6027<\/strong><\/h2>\n<p>KVM\u670d\u52a1\u5668\u5728\u8d44\u6e90\u5206\u914d\u7075\u6d3b\u6027\u65b9\u9762\u8868\u73b0\u51fa\u8272\u3002\u4ee5\u4e0b\u662fKVM\u52a8\u6001CPU\u5206\u914d\u7684\u793a\u4f8b\uff1a<\/p>\n<pre><code>\r\n# \u52a8\u6001CPU\u5206\u914d\r\nvirsh setvcpus --domain instance1 --count 4 --live\r\nvirsh setmem --domain instance1 --size 4096M --live\r\n\r\n# \u76d1\u63a7\u8d44\u6e90\u4f7f\u7528\r\nvirt-top\r\n<\/code><\/pre>\n<p>\u72ec\u7acb\u670d\u52a1\u5668\u867d\u7136\u5728\u5373\u65f6\u8d44\u6e90\u5206\u914d\u65b9\u9762\u4e0d\u592a\u7075\u6d3b\uff0c\u4f46\u80fd\u63d0\u4f9b\u65e0\u865a\u62df\u5316\u5f00\u9500\u7684\u4e00\u81f4\u6027\u80fd\u3002\u5bf9\u4e8e\u9ad8\u6027\u80fd\u8ba1\u7b97\u4efb\u52a1\uff0c\u8bf7\u8003\u8651\u4ee5\u4e0b\u90e8\u7f72\u67b6\u6784\uff1a<\/p>\n<pre><code>\r\n# \u63a8\u8350\u7684\u72ec\u7acb\u670d\u52a1\u5668\u4f18\u5316\r\necho 'never' &gt; \/sys\/kernel\/mm\/transparent_hugepage\/enabled\r\nsysctl -w vm.swappiness=10\r\necho 'performance' | tee \/sys\/devices\/system\/cpu\/cpu*\/cpufreq\/scaling_governor\r\n<\/code><\/pre>\n<h2><strong>\u7f51\u7edc\u6027\u80fd\u548c\u5b89\u5168\u6027<\/strong><\/h2>\n<p>\u9999\u6e2f\u7684\u6218\u7565\u4f4d\u7f6e\u4f7f\u5176\u975e\u5e38\u9002\u5408KVM\u548c\u72ec\u7acb\u670d\u52a1\u5668\u79df\u7528\u89e3\u51b3\u65b9\u6848\u3002\u7f51\u7edc\u6027\u80fd\u6bd4\u8f83\u663e\u793a\uff1a<\/p>\n<ul>\n<li>\u72ec\u7acb\u670d\u52a1\u5668\u5b9e\u73b0\u7a33\u5b9a\u7684\u4e9a\u6beb\u79d2\u7ea7\u672c\u5730\u5ef6\u8fdf<\/li>\n<li>KVM\u5b9e\u4f8b\u663e\u793a\u989d\u59160.2-0.5\u6beb\u79d2\u7684\u7f51\u7edc\u5ef6\u8fdf<\/li>\n<li>\u9ad8\u7aef\u914d\u7f6e\u4e2d\u4e24\u79cd\u89e3\u51b3\u65b9\u6848\u90fd\u652f\u6301\u9ad8\u8fbe10Gbps\u7684\u4e0a\u884c\u94fe\u8def<\/li>\n<\/ul>\n<p>\u4e3a\u589e\u5f3a\u5b89\u5168\u6027\uff0c\u5b9e\u65bd\u4ee5\u4e0b\u57fa\u7ebf\u63aa\u65bd\uff1a<\/p>\n<pre><code>\r\n# \u5b89\u5168\u52a0\u56fa\u793a\u4f8b\r\n# \u9488\u5bf9\u72ec\u7acb\u670d\u52a1\u5668\r\niptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --set\r\niptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 -j DROP\r\n\r\n# \u9488\u5bf9KVM\u5b9e\u4f8b\r\n# \u914d\u7f6e\u9694\u79bb\u7f51\u7edc\r\nvirsh net-define isolated.xml\r\nvirsh net-start isolated\r\nvirsh net-autostart isolated\r\n<\/code><\/pre>\n<h2><strong>\u72ec\u7acb\u670d\u52a1\u5668\u57fa\u7840\u8bbe\u65bd<\/strong><\/h2>\n<p>\u72ec\u7acb\u670d\u52a1\u5668\u4ee3\u8868\u4e13\u95e8\u5206\u914d\u7ed9\u5355\u4e2a\u7528\u6237\u7684\u88f8\u673a\u786c\u4ef6\u3002\u8fd9\u79cd\u67b6\u6784\u6d88\u9664\u4e86\u865a\u62df\u673a\u76d1\u63a7\u7a0b\u5e8f\u5c42\uff0c\u63d0\u4f9b\u5bf9\u7269\u7406\u8d44\u6e90\u7684\u76f4\u63a5\u8bbf\u95ee\u3002\u73b0\u4ee3\u72ec\u7acb\u670d\u52a1\u5668\u901a\u5e38\u5177\u5907\u4f01\u4e1a\u7ea7\u7ec4\u4ef6\uff1a<\/p>\n<ul>\n<li>Intel Xeon\u6216AMD EPYC\u5904\u7406\u5668<\/li>\n<li>ECC\u5185\u5b58\u6a21\u5757<\/li>\n<li>RAID\u914d\u7f6e\u7684NVMe\u5b58\u50a8<\/li>\n<li>\u5197\u4f59\u7535\u6e90<\/li>\n<li>\u4f01\u4e1a\u7ea7\u7f51\u7edc\u63a5\u53e3<\/li>\n<\/ul>\n<h2><strong>\u6027\u80fd\u57fa\u51c6\u6d4b\u8bd5\u548c\u5206\u6790<\/strong><\/h2>\n<p>\u4e3a\u5ba2\u89c2\u6bd4\u8f83KVM\u548c\u72ec\u7acb\u670d\u52a1\u5668\uff0c\u6211\u4eec\u4f7f\u7528\u884c\u4e1a\u6807\u51c6\u5de5\u5177\u8fdb\u884c\u4e86\u5168\u9762\u57fa\u51c6\u6d4b\u8bd5\u3002\u4ee5\u4e0b\u662f\u6211\u4eec\u6d4b\u8bd5\u4e2d\u4f7f\u7528\u7684\u793a\u4f8b\u57fa\u51c6\u6d4b\u8bd5\u811a\u672c\uff1a<\/p>\n<pre><code>\r\n#!\/bin\/bash\r\n# \u670d\u52a1\u5668\u6027\u80fd\u6d4b\u8bd5\u5957\u4ef6\r\nsysbench cpu --cpu-max-prime=20000 run\r\nsysbench memory --memory-block-size=1K --memory-total-size=100G run\r\nfio --name=random-write --ioengine=posixaio --rw=randwrite --bs=4k --size=4g\r\n<\/code><\/pre>\n<h2><strong>\u4e0d\u540c\u5de5\u4f5c\u8d1f\u8f7d\u7684\u6210\u672c\u6548\u76ca\u5206\u6790<\/strong><\/h2>\n<p>\u7406\u89e3\u603b\u62e5\u6709\u6210\u672c\uff08TCO\uff09\u9700\u8981\u5206\u6790\u7279\u5b9a\u7684\u5de5\u4f5c\u8d1f\u8f7d\u6a21\u5f0f\u3002\u4ee5\u4e0b\u662f\u5b9e\u7528\u7684\u90e8\u7f72\u51b3\u7b56\u77e9\u9635\uff1a<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr style=\"border: 1px solid #ddd;\">\n<th style=\"border: 1px solid #ddd; padding: 8px; text-align: left;\">\u5de5\u4f5c\u8d1f\u8f7d\u7c7b\u578b<\/th>\n<th style=\"border: 1px solid #ddd; padding: 8px; text-align: left;\">\u63a8\u8350\u5e73\u53f0<\/th>\n<th style=\"border: 1px solid #ddd; padding: 8px; text-align: left;\">\u7406\u7531<\/th>\n<\/tr>\n<tr style=\"border: 1px solid #ddd;\">\n<td style=\"border: 1px solid #ddd; padding: 8px;\">\u9ad8\u9891\u4ea4\u6613<\/td>\n<td style=\"border: 1px solid #ddd; padding: 8px;\">\u72ec\u7acb\u670d\u52a1\u5668<\/td>\n<td style=\"border: 1px solid #ddd; padding: 8px;\">\u6700\u5c0f\u5ef6\u8fdf\u8981\u6c42<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #ddd;\">\n<td style=\"border: 1px solid #ddd; padding: 8px;\">\u7f51\u7ad9\u6258\u7ba1\u96c6\u7fa4<\/td>\n<td style=\"border: 1px solid #ddd; padding: 8px;\">KVM<\/td>\n<td style=\"border: 1px solid #ddd; padding: 8px;\">\u8d44\u6e90\u4f18\u5316<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #ddd;\">\n<td style=\"border: 1px solid #ddd; padding: 8px;\">\u6570\u636e\u5e93\u670d\u52a1\u5668<\/td>\n<td style=\"border: 1px solid #ddd; padding: 8px;\">\u6df7\u5408\u65b9\u6848<\/td>\n<td style=\"border: 1px solid #ddd; padding: 8px;\">\u6027\u80fd\u548c\u6210\u672c\u7684\u5e73\u8861<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><strong>\u6027\u80fd\u4f18\u5316\u6280\u672f<\/strong><\/h2>\n<p>\u5bf9\u4e8eKVM\u73af\u5883\uff0c\u4f7f\u7528\u8fd9\u4e9b\u7ecf\u8fc7\u9a8c\u8bc1\u7684\u6280\u672f\u6765\u4f18\u5316\u6027\u80fd\uff1a<\/p>\n<pre><code>\r\n# CPU\u7ed1\u5b9a\u914d\u7f6e\r\n&lt;cpu mode='host-passthrough'&gt;\r\n  &lt;topology sockets='1' cores='4' threads='2'\/&gt;\r\n  &lt;numa&gt;\r\n    &lt;cell id='0' cpus='0-7' memory='4096' unit='MiB'\/&gt;\r\n  &lt;\/numa&gt;\r\n&lt;\/cpu&gt;\r\n\r\n# I\/O\u4f18\u5316\r\n&lt;disk type='file' device='disk'&gt;\r\n  &lt;driver name='qemu' type='raw' cache='none' io='native'\/&gt;\r\n  &lt;source file='\/var\/lib\/libvirt\/images\/disk.img'\/&gt;\r\n  &lt;target dev='vda' bus='virtio'\/&gt;\r\n&lt;\/disk&gt;\r\n<\/code><\/pre>\n<h2><strong>\u8fc1\u79fb\u548c\u707e\u96be\u6062\u590d<\/strong><\/h2>\n<p>\u5b9e\u65f6\u8fc1\u79fb\u529f\u80fd\u662fKVM\u73af\u5883\u7684\u4e00\u4e2a\u91cd\u8981\u4f18\u52bf\uff1a<\/p>\n<pre><code>\r\n# \u5b9e\u65f6\u8fc1\u79fb\u793a\u4f8b\r\nvirsh migrate --live --verbose domain-name \\\r\nqemu+ssh:\/\/destination-host\/system \\\r\n--persistent --undefinesource \\\r\n--migrate-disks vda --copy-storage-all\r\n<\/code><\/pre>\n<p>\u5bf9\u4e8e\u72ec\u7acb\u670d\u52a1\u5668\uff0c\u901a\u8fc7\u786c\u4ef6\u590d\u5236\u5b9e\u73b0\u707e\u96be\u6062\u590d\uff1a<\/p>\n<pre><code>\r\n# DRBD\u914d\u7f6e\u793a\u4f8b\r\nresource r0 {\r\n  protocol C;\r\n  disk {\r\n    resync-rate 100M;\r\n    c-plan-ahead 0;\r\n    c-max-rate 100M;\r\n    c-fill-target 24M;\r\n  }\r\n  net {\r\n    max-buffers 2048;\r\n    max-epoch-size 2048;\r\n  }\r\n  syncer {\r\n    rate 100M;\r\n  }\r\n}\r\n<\/code><\/pre>\n<h2><strong>\u5b9e\u9645\u5e94\u7528\u573a\u666f<\/strong><\/h2>\n<p>\u8ba9\u6211\u4eec\u6765\u770b\u770b\u4ece\u9999\u6e2f\u6570\u636e\u4e2d\u5fc3\u90e8\u7f72\u4e2d\u6536\u96c6\u7684\u5177\u4f53\u4f7f\u7528\u6848\u4f8b\u6027\u80fd\u6307\u6807\uff1a<\/p>\n<ul>\n<li><strong>\u7535\u5b50\u5546\u52a1\u5e73\u53f0\uff08\u9ad8\u6d41\u91cf\uff09<\/strong>\n<ul>\n<li>KVM\uff1a\u5f39\u6027\u8d44\u6e90\u5206\u914d\uff0c99.95%\u8fd0\u884c\u65f6\u95f4<\/li>\n<li>\u72ec\u7acb\u670d\u52a1\u5668\uff1a\u7a33\u5b9a\u6027\u80fd\uff0c99.99%\u8fd0\u884c\u65f6\u95f4<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u6e38\u620f\u670d\u52a1\u5668<\/strong>\n<ul>\n<li>KVM\uff1a\u5230\u4e1c\u5357\u4e9a\u5e73\u5747\u5ef6\u8fdf15-20\u6beb\u79d2<\/li>\n<li>\u72ec\u7acb\u670d\u52a1\u5668\uff1a\u5230\u4e1c\u5357\u4e9a\u5e73\u5747\u5ef6\u8fdf8-12\u6beb\u79d2<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2><strong>\u76d1\u63a7\u548c\u7ba1\u7406\u5de5\u5177<\/strong><\/h2>\n<p>\u5bf9\u4e24\u4e2a\u5e73\u53f0\u5b9e\u65bd\u5168\u9762\u7684\u76d1\u63a7\u89e3\u51b3\u65b9\u6848\u81f3\u5173\u91cd\u8981\uff1a<\/p>\n<pre><code>\r\n# Prometheus\u670d\u52a1\u5668\u76d1\u63a7\u914d\u7f6e\r\nglobal:\r\n  scrape_interval: 15s\r\n  evaluation_interval: 15s\r\n\r\nscrape_configs:\r\n  - job_name: 'node'\r\n    static_configs:\r\n      - targets: ['localhost:9100']\r\n  - job_name: 'kvm-metrics'\r\n    static_configs:\r\n      - targets: ['localhost:9090']\r\n<\/code><\/pre>\n<h2><strong>\u9762\u5411\u672a\u6765\u7684\u57fa\u7840\u8bbe\u65bd<\/strong><\/h2>\n<p>\u5728\u89c4\u5212\u53ef\u6269\u5c55\u6027\u65f6\uff0c\u8003\u8651\u8fd9\u4e9b\u9488\u5bf9\u4e24\u4e2a\u5e73\u53f0\u7684\u81ea\u52a8\u5316\u811a\u672c\uff1a<\/p>\n<pre><code>\r\n# Ansible\u81ea\u52a8\u90e8\u7f72\u811a\u672c\r\n---\r\n- hosts: servers\r\n  become: yes\r\n  tasks:\r\n    - name: \u66f4\u65b0\u7cfb\u7edf\r\n      apt:\r\n        update_cache: yes\r\n        upgrade: dist\r\n    \r\n    - name: \u5b89\u88c5\u76d1\u63a7\u5de5\u5177\r\n      apt:\r\n        name: \"{{ packages }}\"\r\n        state: present\r\n      vars:\r\n        packages:\r\n          - prometheus-node-exporter\r\n          - netdata\r\n          - iotop\r\n<\/code><\/pre>\n<h2><strong>\u7ed3\u8bba<\/strong><\/h2>\n<p>\u5728KVM\u548c\u72ec\u7acb\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u9009\u62e9\u6700\u7ec8\u53d6\u51b3\u4e8e\u5177\u4f53\u7684\u5de5\u4f5c\u8d1f\u8f7d\u8981\u6c42\u548c\u4e1a\u52a1\u76ee\u6807\u3002\u5bf9\u4e8e\u9700\u8981\u6700\u5927\u63a7\u5236\u6743\u548c\u6027\u80fd\u7684\u7ec4\u7ec7\u6765\u8bf4\uff0c\u72ec\u7acb\u670d\u52a1\u5668\u4ecd\u7136\u662f\u6700\u4f73\u9009\u62e9\u3002\u7136\u800c\uff0cKVM\u89e3\u51b3\u65b9\u6848\u5728\u6210\u672c\u6548\u76ca\u548c\u8d44\u6e90\u7075\u6d3b\u6027\u65b9\u9762\u63d0\u4f9b\u4e86\u4ee4\u4eba\u4fe1\u670d\u7684\u4f18\u52bf\uff0c\u7279\u522b\u662f\u5728\u9999\u6e2f\u7684\u670d\u52a1\u5668\u79df\u7528\u73af\u5883\u4e2d\uff0c\u57fa\u7840\u8bbe\u65bd\u6210\u672c\u662f\u4e00\u4e2a\u91cd\u8981\u8003\u8651\u56e0\u7d20\u3002<\/p>\n<p>\u57fa\u4e8e\u5f7b\u5e95\u7684\u6d4b\u8bd5\u548c\u6027\u80fd\u8981\u6c42\u505a\u51fa\u51b3\u7b56\uff0c\u800c\u4e0d\u662f\u57fa\u4e8e\u4e00\u822c\u6027\u5efa\u8bae\u3002\u5728\u9009\u62e9KVM\u670d\u52a1\u5668\u548c\u72ec\u7acb\u670d\u52a1\u5668\u79df\u7528\u89e3\u51b3\u65b9\u6848\u65f6\uff0c\u8981\u8003\u8651\u5de5\u4f5c\u8d1f\u8f7d\u6a21\u5f0f\u3001\u53ef\u6269\u5c55\u6027\u9700\u6c42\u548c\u6280\u672f\u4e13\u4e1a\u77e5\u8bc6\u7b49\u56e0\u7d20\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4e0d\u65ad\u53d1\u5c55\u7684\u670d\u52a1\u5668\u57fa\u7840\u8bbe\u65bd\u9886\u57df\u4e2d\uff0c\u5728KVM\uff08\u57fa\u4e8e\u5185\u6838\u7684\u865a\u62df\u673a\uff09\u548c\u72ec\u7acb\u670d\u52a1\u5668\u4e4b\u95f4\u505a\u51fa\u9009\u62e9\uff0c\u5bf9\u5bfb\u6c42\u6700\u4f73\u670d\u52a1\u5668\u79df\u7528\u89e3\u51b3\u65b9\u6848\u7684IT\u4e13\u4e1a\u4eba\u5458\u6765\u8bf4\u662f\u4e00\u4e2a\u5173\u952e\u51b3\u7b56\u3002\u672c\u6280\u672f\u5206\u6790\u6df1\u5165\u63a2\u8ba8\u4e86\u8fd9\u4e24\u79cd\u670d\u52a1\u5668\u7c7b\u578b\u5728\u9999\u6e2f\u52a8\u6001\u670d\u52a1\u5668\u79df\u7528\u73af\u5883\u4e2d\u7684\u67b6\u6784\u5dee\u5f02\u3001\u6027\u80fd\u6307\u6807\u548c\u5b9e\u9645\u5e94\u7528\u3002 \u7406\u89e3KVM\u67b6\u6784 KVM\u4f5c\u4e3a\u96c6\u6210\u5230Linux\u5185\u6838\u4e2d\u76841\u578b\u865a\u62df\u673a\u76d1\u63a7\u7a0b\u5e8f\uff0c\u5c06Linux\u5185\u6838\u8f6c\u53d8\u4e3a\u88f8\u673a\u865a\u62df\u673a\u76d1\u63a7\u7a0b\u5e8f\u3002\u901a\u8fc7\u865a\u62df\u5316\u6269\u5c55\uff08Intel VT-x\u6216AMD-V\uff09\uff0c\u8fd9\u79cd\u67b6\u6784\u80fd\u591f\u76f4\u63a5\u8bbf\u95ee\u786c\u4ef6\uff0c\u4e0e\u4f20\u7edf\u7684\u865a\u62df\u79c1\u6709\u670d\u52a1\u5668\uff08VPS\uff09\u76f8\u6bd4\uff0c\u663e\u8457\u964d\u4f4e\u4e86\u865a\u62df\u5316\u5f00\u9500\u3002 # \u5728Linux\u4e0a\u68c0\u67e5KVM\u652f\u6301\u7684\u793a\u4f8b egrep -c &#8216;(vmx|svm)&#8217; \/proc\/cpuinfo # \u57fa\u672cKVM\u521b\u5efa\u547d\u4ee4 virt-install \\ &#8211;name=instance1 \\ &#8211;vcpus=2 \\ &#8211;memory=2048 \\ &#8211;disk path=\/var\/lib\/libvirt\/images\/instance1.qcow2,size=20 \\ &#8211;os-type=linux \\ &#8211;network bridge=br0 \u6211\u4eec\u7684\u57fa\u51c6\u6d4b\u8bd5\u7ed3\u679c\u663e\u793a\u4e86KVM\u548c\u72ec\u7acb\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u663e\u8457\u6027\u80fd\u7279\u5f81\uff1a \u6307\u6807 KVM\u670d\u52a1\u5668 \u72ec\u7acb\u670d\u52a1\u5668 CPU\u8fd0\u7b97\/\u79d2 \u7ea6\u4e3a\u88f8\u673a\u768495% 100%\uff08\u57fa\u51c6\uff09 \u5185\u5b58\u5ef6\u8fdf \u989d\u59162-5%\u5f00\u9500 \u539f\u751f\u901f\u5ea6 I\/O\u6027\u80fd \u88f8\u673a\u768485-90% \u5b8c\u6574\u786c\u4ef6\u901f\u5ea6 \u8d44\u6e90\u7ba1\u7406\u548c\u53ef\u6269\u5c55\u6027 KVM\u670d\u52a1\u5668\u5728\u8d44\u6e90\u5206\u914d\u7075\u6d3b\u6027\u65b9\u9762\u8868\u73b0\u51fa\u8272\u3002\u4ee5\u4e0b\u662fKVM\u52a8\u6001CPU\u5206\u914d\u7684\u793a\u4f8b\uff1a # \u52a8\u6001CPU\u5206\u914d virsh setvcpus &#8211;domain instance1 &#8211;count 4 &#8211;live virsh setmem &#8211;domain instance1 [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/kvm-vs-dedicated-servers-a-technical-deep-dive\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":18210,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[62],"tags":[4438,3838,1239,353,211],"class_list":["post-18238","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hong-kong-dedicated-server-sc","tag-kvm-servers-sc","tag-bare-metal-servers-sc","tag-server-performance-sc","tag-server-rental-sc","tag-dedicated-servers-sc"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>KVM\u4e0e\u72ec\u7acb\u670d\u52a1\u5668\uff1a\u6280\u672f\u6df1\u5ea6\u89e3\u6790<\/title>\n<meta name=\"description\" content=\"\u6df1\u5165\u4e86\u89e3KVM\u548c\u72ec\u7acb\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u6280\u672f\u5dee\u5f02\u3002\u6bd4\u8f83\u6027\u80fd\u6307\u6807\u3001\u865a\u62df\u5316\u5f00\u9500\u3001\u8d44\u6e90\u5206\u914d\u548c\u670d\u52a1\u5668\u79df\u7528\u89e3\u51b3\u65b9\u6848\u7684\u5b9e\u9645\u6027\u80fd\u57fa\u51c6\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/18238\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"company\" \/>\n<meta property=\"og:title\" content=\"KVM\u4e0e\u72ec\u7acb\u670d\u52a1\u5668\uff1a\u6280\u672f\u6df1\u5ea6\u89e3\u6790\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/18238\" \/>\n<meta property=\"og:site_name\" content=\"\u65b0\u5929\u57df\u4e92\u8054\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-31T04:23:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-31T04:28:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/10\/sim-blog-2024-10-31-blogC.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"612\" \/>\n\t<meta property=\"og:image:height\" content=\"339\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"KVM\u4e0e\u72ec\u7acb\u670d\u52a1\u5668\uff1a\u6280\u672f\u6df1\u5ea6\u89e3\u6790","description":"\u6df1\u5165\u4e86\u89e3KVM\u548c\u72ec\u7acb\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u6280\u672f\u5dee\u5f02\u3002\u6bd4\u8f83\u6027\u80fd\u6307\u6807\u3001\u865a\u62df\u5316\u5f00\u9500\u3001\u8d44\u6e90\u5206\u914d\u548c\u670d\u52a1\u5668\u79df\u7528\u89e3\u51b3\u65b9\u6848\u7684\u5b9e\u9645\u6027\u80fd\u57fa\u51c6\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/18238","og_locale":"zh_CN","og_type":"company","og_title":"KVM\u4e0e\u72ec\u7acb\u670d\u52a1\u5668\uff1a\u6280\u672f\u6df1\u5ea6\u89e3\u6790","og_url":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/18238","og_site_name":"\u65b0\u5929\u57df\u4e92\u8054","article_published_time":"2024-10-31T04:23:56+00:00","article_modified_time":"2024-10-31T04:28:53+00:00","og_image":[{"width":612,"height":339,"url":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/10\/sim-blog-2024-10-31-blogC.jpg","type":"image\/jpeg"}],"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/kvm-vs-dedicated-servers-a-technical-deep-dive\/#article","isPartOf":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/kvm-vs-dedicated-servers-a-technical-deep-dive\/"},"author":{"name":"Tommy Cheung","@id":"https:\/\/simcentric.com\/tc\/#\/schema\/person\/631e153fdae3d1c71e500611868451e8"},"headline":"KVM\u4e0e\u72ec\u7acb\u670d\u52a1\u5668\uff1a\u6280\u672f\u6df1\u5ea6\u89e3\u6790","datePublished":"2024-10-31T04:23:56+00:00","dateModified":"2024-10-31T04:28:53+00:00","mainEntityOfPage":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/kvm-vs-dedicated-servers-a-technical-deep-dive\/"},"wordCount":44,"publisher":{"@id":"https:\/\/simcentric.com\/tc\/#organization"},"image":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/kvm-vs-dedicated-servers-a-technical-deep-dive\/#primaryimage"},"thumbnailUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/10\/sim-blog-2024-10-31-blogC.jpg","keywords":["KVM\u670d\u52a1\u5668","\u88f8\u91d1\u5c5e\u670d\u52a1\u5668","\u670d\u52a1\u5668\u6027\u80fd","\u670d\u52a1\u5668\u79df\u7528","\u72ec\u7acb\u670d\u52a1\u5668"],"articleSection":["\u9999\u6e2f\u670d\u52a1\u5668"],"inLanguage":"zh-CHN"},{"@type":"WebPage","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/kvm-vs-dedicated-servers-a-technical-deep-dive\/","url":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/kvm-vs-dedicated-servers-a-technical-deep-dive\/","name":"KVM\u4e0e\u72ec\u7acb\u670d\u52a1\u5668\uff1a\u6280\u672f\u6df1\u5ea6\u89e3\u6790","isPartOf":{"@id":"https:\/\/simcentric.com\/tc\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/kvm-vs-dedicated-servers-a-technical-deep-dive\/#primaryimage"},"image":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/kvm-vs-dedicated-servers-a-technical-deep-dive\/#primaryimage"},"thumbnailUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/10\/sim-blog-2024-10-31-blogC.jpg","datePublished":"2024-10-31T04:23:56+00:00","dateModified":"2024-10-31T04:28:53+00:00","description":"\u6df1\u5165\u4e86\u89e3KVM\u548c\u72ec\u7acb\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u6280\u672f\u5dee\u5f02\u3002\u6bd4\u8f83\u6027\u80fd\u6307\u6807\u3001\u865a\u62df\u5316\u5f00\u9500\u3001\u8d44\u6e90\u5206\u914d\u548c\u670d\u52a1\u5668\u79df\u7528\u89e3\u51b3\u65b9\u6848\u7684\u5b9e\u9645\u6027\u80fd\u57fa\u51c6\u3002","breadcrumb":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/kvm-vs-dedicated-servers-a-technical-deep-dive\/#breadcrumb"},"inLanguage":"zh-CHN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/kvm-vs-dedicated-servers-a-technical-deep-dive\/"]}]},{"@type":"ImageObject","inLanguage":"zh-CHN","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/kvm-vs-dedicated-servers-a-technical-deep-dive\/#primaryimage","url":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/10\/sim-blog-2024-10-31-blogC.jpg","contentUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/10\/sim-blog-2024-10-31-blogC.jpg","width":612,"height":339,"caption":"KVM\u4e0e\u4e13\u7528\u670d\u52a1\u5668\u6027\u80fd\u6bd4\u8f83"},{"@type":"BreadcrumbList","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/kvm-vs-dedicated-servers-a-technical-deep-dive\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.simcentric.com\/sc\/"},{"@type":"ListItem","position":2,"name":"KVM\u4e0e\u72ec\u7acb\u670d\u52a1\u5668\uff1a\u6280\u672f\u6df1\u5ea6\u89e3\u6790"}]},{"@type":"WebSite","@id":"https:\/\/simcentric.com\/tc\/#website","url":"https:\/\/simcentric.com\/tc\/","name":"Simcentric Solutions","description":"","publisher":{"@id":"https:\/\/simcentric.com\/tc\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/simcentric.com\/tc\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-CHN"},{"@type":"Organization","@id":"https:\/\/simcentric.com\/tc\/#organization","name":"Simcentric Solutions","url":"https:\/\/simcentric.com\/tc\/","logo":{"@type":"ImageObject","inLanguage":"zh-CHN","@id":"https:\/\/simcentric.com\/tc\/#\/schema\/logo\/image\/","url":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2023\/06\/sim-logo-2023.png","contentUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2023\/06\/sim-logo-2023.png","width":800,"height":222,"caption":"Simcentric Solutions"},"image":{"@id":"https:\/\/simcentric.com\/tc\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/simcentric.com\/tc\/#\/schema\/person\/631e153fdae3d1c71e500611868451e8","name":"Tommy Cheung","image":{"@type":"ImageObject","inLanguage":"zh-CHN","@id":"https:\/\/secure.gravatar.com\/avatar\/a2e7d94371b76574e2ddc0f18834f815c0329507429c6613f6a7bc9435dc6fd2?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a2e7d94371b76574e2ddc0f18834f815c0329507429c6613f6a7bc9435dc6fd2?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a2e7d94371b76574e2ddc0f18834f815c0329507429c6613f6a7bc9435dc6fd2?s=96&d=mm&r=g","caption":"Tommy Cheung"},"sameAs":["https:\/\/simrevamp2023.sim-dp.com"]}]}},"_links":{"self":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/18238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/comments?post=18238"}],"version-history":[{"count":2,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/18238\/revisions"}],"predecessor-version":[{"id":18242,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/18238\/revisions\/18242"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/media\/18210"}],"wp:attachment":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/media?parent=18238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/categories?post=18238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/tags?post=18238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}