码迷,mamicode.com
首页 > 其他好文 > 详细

虚拟机的优化

时间:2016-07-06 01:41:45      阅读:232      评论:0      收藏:0      [点我收藏+]

标签:

[root@ok Desktop]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    2
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 60
Stepping:              3
CPU MHz:               800.000
BogoMIPS:              5188.22
Virtualization:        VT-x
L1d cache:             32K#一级缓存分为数据和指今缓存
L1i cache:             32K#一级缓存是静怸内存
L2 cache:              256K#二级缓存是共享的(一个CPU中的多个核共享)
L3 cache:              3072K#二三是高速的动态内存
NUMA node0 CPU(s):     0-3
[root@ok Desktop]# lscpu -p
# The following is the parsable format, which can be fed to other
# programs. Each different item in every column has an unique ID
# starting from zero.
# CPU,Core,Socket,Node,,L1d,L1i,L2,L3
0,0,0,0,,0,0,0,0
1,0,0,0,,0,0,0,0
2,1,0,0,,1,1,1,0
3,1,0,0,,1,1,1,0

把QEMU进程绑定在CPU上,减少缓存丢失的情况

[root@ok Desktop]# taskset --help
taskset (util-linux-ng 2.17.2)
usage: taskset [options] [mask | cpu-list] [pid | cmd [args...]]
set or get the affinity of a process

  -p, --pid                  operate on existing given pid
  -c, --cpu-list             display and specify cpus in list format
  -h, --help                 display this help
  -V, --version              output version information

The default behavior is to run a new command:
  taskset 03 sshd -b 1024
You can retrieve the mask of an existing task:
  taskset -p 700
Or set it:
  taskset -p 03 700
List format uses a comma-separated list instead of a mask:
  taskset -pc 0,3,7-11 700
Ranges in list format can take a stride argument:
  e.g. 0-31:2 is equivalent to mask 0x55555555

 DMA 直接内存访问

大页内存

[root@ok Desktop]# cat /proc/sys/vm/swappiness 
60

 

IO的调度算法;
[root@ok Desktop]# cat /sys/block/sda/queue/scheduler 
noop anticipatory deadline [cfq]
默认的是cfq(保证每个进程的IO都比效平均)
deadline:主要用于CPU(如果是数据库的调优的诚征最好是用这种方法)
noop:是没有做何的算法(用SSD的硬盘话 就必需要用这个)

 

虚拟机的优化

标签:

原文地址:http://www.cnblogs.com/bass6/p/5645467.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!