陈沙克

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 122012
 

Folsom,也是可以在ubuntu 12.04安装,现在官方的包已经推出

https://launchpad.net/~openstack-ubuntu-testing/+archive/folsom-trunk-testing

你直接添加就可以

sudo apt-add-repository ppa:openstack-ubuntu-testing/folsom-trunk-testing

目前还是F2的版本,估计等到F3再测试比较合适,如果是刚开始研究,其实也可以从F2就开始。安装估计是差不多。

未来ubuntu的官方的政策会支持后续的版本在ubuntu 12.04安装,这倒是比较方便,我也不需要去尝试ubuntu的新版本.

Jul 112012
 

一直很困扰的一个问题,如果修改windows 2008的sid。目前在2008上,newsid已经无法使用,使用微软提供的工具,会让你全部的设置都失效.

昨晚和以前同事吃饭,专门请教了这个问题。同事以前是在微软,现在Citrix。回答应该是很权威。

答案很出乎我的意料,不需要修改sid,sid相同不会有任何的影响。在他的环境下,没遇到任何的麻烦。

在newsid的作者的blog上有专门的说明.

http://blogs.technet.com/b/markrussinovich/archive/2009/11/03/3291024.aspx

看来落后了.真的要经常和专家吃饭.

Jul 112012
 

现在已经开始同步到各大镜像站点。估计明天应该就可以下载使用。这算是有史以来最快的一次。Redhat RHEL 6.3 是6月26号发布,半个月的时候,就推出CentOS 6.3. 这次速度快,还在于Redhat推出Beta的时候,他们就开始动手准备。我已经在sohu的镜像里看到6.3的目录。

最难得的是这次通过blog,告诉大家开发的进度。比较公开透明。

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

The CentOS-6.3 tree is now syncing to the external mirrors. Our mirrorlist and isoredirect scripts are looking for external mirrors with content and some time within the next 12 or so hours, CentOS-6.3 will be released.

A big thanks to all involved, especially the QA team, for the work accomplished to get this release out.

Jul 092012
 

你首先是需要申请开通SSH权限,这是需要人工审查.详细申请过程,http://www.chenshake.com/bluehost-request-open-ssh-permissions/

人工审核通过,你还是需要设置才能使用ssh.

1: cpanel设置允许ssh

no shell

noshell, 这个时候,如果你翻墙应该是没问题。

ssh

如果你希望可以ssh访问服务器,那么就需要一个shell。考虑很周到。

 

2: ssh登陆

bluehost的统一身份认证做的很好。这个时候,你ssh登陆的密码,就是你登陆bluehost的密码。

 

3:采用密钥登陆

你可以设置ssh采用密钥登陆。

Jul 092012
 

以前我用cnzz,不过看看百度统计如何。blog的访问量都是来自中国,看看百度能分析出啥。

百度统计后台有帮助,如何在wordpress加入统计代码

首先在百度统计获取安装代码,在后台文件中查找 wp-content/themes-名字/footer.php 文件,然后打开,将百度统计代码复制粘贴到页尾</body>的前面,保存并更新文件。

就这么简单.观察几天,看看效果如何。再加入google统计。

2012年10月15日更新

这样添加代码的一个缺点就是如果主题更新,那么你就需要重新添加。还有就是毕竟是需要手工去改代码。

如果你使用的是Suffusion 主题,那么就恭喜你,里面内置了可以添加分析代码的地方,可以让你升级也不影响。

我同时放置了google和百度的统计代码,运行良好。

百度分析