Jul 122012
 

对于KVM的优化,其实很少文章提交.今天刚好在邮件列表里看到,我也刚好能看懂.

在Redhat RHEL 6,有一个功能,就是内存合并, 简单说,就是把相同的内存合并,这样可以让你的系统跑更多的虚拟机.不过肯定也会造成性能的影响.

默认这个功能是开启的.如何关闭, 什么时候关闭. 开启的时候,有什么地方可以优化.

看原文吧,还是有收获的.How to improve KVM performance by adjusting KSM

发现文章是需要注册才能看到,这里就转载一下.

While the kernel-based virtual machine (KVM) is designed to self-optimize, there are a few parameters that can be adjusted to make a KVM host perform better. The most important of these is kernel samepage merging (KSM), a feature that allows the kernel to handle memory more efficiently. KSM allows the Linux kernel to recognize memory pages that contain the same content, then it can merge these memory pages, consolidating the data to one location to be referred to multiple times.

If KVM is used on a host, typically several guest operating systems (OSes) are activated and often these are running the same OS, which means that a huge amount of kernel pages are loaded multiple times. By applying KSM, more virtual machines (VMs) can be started using same amount of memory. In fact, KSM allows over-committing of  VMs. But, there is a performance penalty for using KSM. In average environments the performance price is about 10%, which is a reason to turn KSM off in some environments.

In Red Hat Enterprise Linux 6 and Fedora 14, KSM is switched on by default. It is implemented by two services that are started automatically at system initialization: ksmd and ksmtuned. Administrators should judge their environment and determine whether to keep KSM on or turn it off.

Determining whether to use KSM, or turn it off
If the purpose is to run as many VMs as possible, and performance is not an issue, KSM should be kept running. For example, it allows running 40 VMs on a host normally capable of running 30 VMs, which means maximum hardware usage efficiency. But, if a server is running with a relatively small amount of VMs and performance is an issue, KSM should be turned off.

The best choice for any system will depend on the memory calculation made while creating the virtual environment. If there is enough physical RAM in the virtualization host to meet the memory needs of the VMs without KSM, it is better to switch it off. Use chkconfig ksmd off, chkconfig ksmtuned off, service ksmd off and service ksmtuned off to switch off all parts of KSM. But if a host is tight on memory, it’s better to keep it on.

Tuning KSM for best performance
When using KSM, some of its parameters can be tuned for best performance. They are located in a small configuration file named /etc/ksmtuned.conf:

 

# Configuration file for ksmtuned.
# How long ksmtuned should sleep between tuning adjustments
# KSM_MONITOR_INTERVAL=60
# Millisecond sleep between ksm scans for 16Gb server.
# Smaller servers sleep more, bigger sleep less.
# KSM_SLEEP_MSEC=10
# KSM_NPAGES_BOOST=300
# KSM_NPAGES_DECAY=-50
# KSM_NPAGES_MIN=64
# KSM_NPAGES_MAX=1250
# KSM_THRES_COEF=20
# KSM_THRES_CONST=2048
# uncomment the following if you want ksmtuned debug info
# LOGFILE=/var/log/ksmtuned
# DEBUG=1

The most important parameters in the configuration file is KSM_SLEEP_MSEC. The default value that is used on Fedora 14 is set for large servers. When running a few VMs on a host while using KSM, it’s better to give the host a higher sleep time. For example, try KSM_SLEEP_MSEC=50 to test the effect on the VMs.

Jul 082012
 

最近CentOS动作明显比以前快很多,不只是发布速度加快,并且更加透明。告诉大家现在在做啥,遇到什么问题。进度等。这样用户的感觉好很多。

RedHat 6.3是6月26号发布, 那么估计这次就用了不到半个月的时间就搞定.让大家对CentOS的未来更有信心.

打算CentOS 6.3发布后,重新搭建一个cobbler,实现支持CentOS和Ubuntu

http://qaweb.dev.centos.org/qa/blog

Jul 052012
 

记忆的很清楚,2000年的时候,当时还是Compaq,推出第一款远程控制卡,当时听起来非常神奇。可以远程开机,关机,安装系统。那个时候,我没真正用过,只是看产品介绍。

2006年的时候,当时的Dell服务器,应该是29系列,你购买的时候,需要单独选购远程控制卡,当时我是使用这个远程控制卡来玩vmware的ESX。

自后就一直没有怎么接触服务器,一直到来这家公司。公司有各个牌子的服务器。服务器在机房放着,进去维护非常不方便,我也就折腾起远程管理。

下面就整理一下全部的IPMI的资料

http://www.openfusion.net/linux/ipmi_on_centos

参考上面的连接,很多高级功能。

IPMI设置

IPMI需要进入bios,进行设置IP地址。这个本身没什么特别。不过有时候你会发现设置完IPMI的IP地址后,无法访问,也无法ping通。你会以为IPMI出问题了。

这个时候,你需要完全拔掉机器的电源,等待5分钟,把网线插入IPMI的网卡。这个时候,插上电源,就算不开机,也应该可以ping通,访问。这个问题折腾了我很长时间。

机器加电前,需要把IPMI的网线插上,这样可以初始化。

另外默认IPMI是DHCP获得IP。

IPMI访问

国产服务器的IPMI访问的用户和密码,基本就是这些。这个和主板有关。我见过的两种主板的IPMI就是超微和泰安的。他们间功能上有点区别,默认的密码也是不一样。

联想:用户名:albert  pass:admin

超微:用户名:ADMIN  pass:ADMIN

泰安的主板:user:root  pass:superuser

浪潮服务器:user:root  pass:superuser

Continue reading »

Jul 022012
 

ubuntu 12.04,改动很大。有时候你发现连机器的dns设置都不会。

/etc/resolv.conf 一般都是修改这个文件就可以。不过现在不行了。

https://help.ubuntu.com/12.04/serverguide/network-configuration.html#name-resolution

http://wiki.debian.org/NetworkConfiguration#The_resolvconf_program

http://ubuntuforums.org/showthread.php?t=1972424

最简单就是删除resolvconf

apt-get remove resolvconf

这样就和以前一样。你可以通过 /etc/resolv.conf 管理dns。

2012年7月19日更新

深入学习了一下ubuntu官方文档 https://help.ubuntu.com/12.04/serverguide/network-configuration.html

对于ubuntu 12.04日后的操作系统,dns的设置,推荐在网卡直接设置。

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.1.199.17
hwaddress ether 00:25:90:67:ce:64
netmask 255.255.255.0
network 10.1.199.0
gateway 10.1.199.1
dns-search chenshake.com
dns-nameservers 8.8.8.8

auto eth1
iface eth1 inet manual
up ifconfig eth1 up

注意是:dnsservers