Introduction to Xen and introduction to virtual xen
1. Introduction to related knowledge:
1> common disk I/O schedulers:
CFQ: completely fair queue algorithm;
Deadline: deadline algorithm;
Anticipatory: sequential read/write queue algorithm/Expectation Algorithm;
NOOP: no operation, the simplest scheduling algorithm;
2> how to replace the I/O Scheduling Algorithm: the default algorithm is CFQ;
/Sys/block/<device>/queue/scheduler
3> memory:
MMU: the abbreviation of Memory Management Unit. The Chinese name is the Memory Management Unit. It is the control line used by the central processor (CPU) to manage Virtual Memory and physical Memory, it is also responsible for ing virtual addresses to physical addresses, providing hardware-based Memory Access authorization, and multi-user multi-process operating systems;
TLB: the abbreviation of (Translation Lookaside Buffer). The conversion detection Buffer is a memory management unit used to improve the cache for converting virtual addresses to physical addresses;
Vm. swapiness = {0 .. 100}: tendency to use swap partitions. The default value is 60. The smaller the value, the less inclined;
Overcommit_memory = 2: excessive use;
Overcommit_ratio = 50: Percentage
Swap + RAM * ratio;
Swap: 2g ram: 8G available: 4 + 8*1/2 = 6G
How to make full use of physical memory:
1) set swap to the same as the RAM physical memory: swappiness = 0;
2) overcommit_memory = 2, overcommit_ratio = 100, swappiness = 0;
Memory: swap + ram
3) tcp_max_tw_buckets: Increase the value of tcp_max_tw_buckets, and save the number of connections allowed for tcp connections. Do not overflow the value. tw is the status generated by the active disconnected party;
IPC:
Message:
Msgmni, msgmax, msgmnb
Shm:
Shmall, shmmax, shmmni
4> performance monitoring commands:
Sar, dstat, vmstat, mpstat, iostat, top, free, iotop, uptime, cat/proc/meminfo, ss, netstat, lsof, time, perf, strace
Blktrace, blkparse, btt
Dd, iozone, io-stress, fio
5> for the kernel:
CPU: Full CPU time slice;
Memory: continuous, and all memory space (must begin with 0x0000 ,);
I/O: all available I/O;
2. virtualization technology basics:
1> implement address conversion using the shadow MMU:
Intel and AMD improve the performance of the Shadow MMU for virtual applications by using EPT (Extended Page Tables) and neted (Nested Page Tables) TLB is used to prevent the virtual machine from switching to the time-frequency complex definition (flush) TLB to improve the TLB cache hit rate;
2> enable virtualization kernel options for Intel and AMD:
Intel: VT-x
AMD: AMD-v
3> I/O Virtualization:
Virtual machines are virtual hardware devices required by themselves through software virtualization;
4> full virtualization and semi-Virtualization:
Semi-Virtualization has better performance than full virtualization, And it is faster to deal with hardware devices;
Full Virtualization:
CPU does not support hardware virtualization technology: Simulate privileged commands; simulate
CPU supports Hardware virtualization technology: VMM runs ring-1 while GuestOS runs ring-0. HVM (Hardware-asistant VM)
Semi-Virtualization:
CPU, IO, MEMORY;
PV on HVM: the CPU-assisted virtualization technology is used to reduce the load and the pv capability of I/O. In this way, the system performance is good;
5> virtualization model:
1) Vmware workstattion, Vmware Server:
2) Vmware ESX and Vmware ESXi:
Install Vmware directly on a physical machine without installing any operating system;
3) XEN Virtualization (QEMU: cross-platform virtualization ):
6> Kernel-based Virtual Machine (KVM) Virtualization: Kernel-based Virtual machines; KVM + Qemu
7> Virtualization:
Intel: IOMMU
X86: VT-x, EPT, IOMMU
8> X86 Platform:
CPU:
Intel: VT-x
AMD: AMD-v
MMU:
Intel EPT
AMD NTS
IO:
Intel IOMMU
3. Implementation of Xen virtualization and DomU:
1> Xen Virtualization:
RHEL5.3: Xen
RHEL5.4: Xen and KVM
RHEL6.0: KVM (64 bits)
RHEL6.0: DomU, but Dom0 cannot be run
Linux: 2.6.24 + pvops frameowrk
DomU
Linux: 2.6.37 (3.0 +)
Dom0
Xen:
Kernel/xen.gz
Module/
Module/
Xen-4.0:
Xend/xm
Xen-4.1:
Xl, xend/xm
Xen-4.2:
Xl
2> the 64-bit Red Hat 6.4 supports the Dom0 running method:
1) download and install the latest kernel version;