Archive for 1月, 2008

linux 和unix下SAR命令的用法,对机器性能检测很有帮助

星期三, 1月 30th, 2008

linux 和unix下SAR命令的用法,对机器性能检测很有帮助

dmesg可以直接查看cpu的主频,要查看CPU、内存的使用情况可以使用sar!

sar 命令行的常用格式:
sar [options] [-A] [-o file] t [n]

在命令行中,n 和t 两个参数组合起来定义采样间隔和次数,t为采样间隔,是必须有
的参数,n为采样次数,是可选的,默认值是1,-o file表示将命令结果以二进制格式
存放在文件中,file 在此处不是关键字,是文件名。options 为命令行选项,sar命令
的选项很多,下面只列出常用选项: (more…)

安装balance

星期三, 1月 30th, 2008

安装balance
该文是2006年整理的,现在跟大家一起分享,希望大家能多提建议和意见,谢谢!

balance是一款负载均衡软件,具体信息可以去看其官方:http://www.inlab.de/balance.html

系统:Centos4.3 i386(在x64上也测试成功过)

1. 下载:

[shell]
wget -c http://www.inlab.de/balance-3.34.tar.gz
[/shell]

(more…)

[更新]-一个测试的数据,嘿嘿

星期一, 1月 28th, 2008

该服务器是DELL1950,跑的是PHP的程序,看图吧,哈哈^_^
嘿嘿
注意看ESTABLISHED的连接:)

blitz-templates(最快的 PHP 模板引擎)

星期一, 1月 28th, 2008

Blitz Templates
Extremely fast and powerfull template engine for very big internet projects

Downloads: sourceforge, sources homepage, win32 binaries
Other languages: russian

Blitz project is in a quite active development stage, new releases may appear once a week. If you want to get new release announcements - please subscribe at freashmeat or sourceforge file releases RSS. If you like this project ant want to help it - i’m always open for any constructive suggestions. We’re still looking for people who could help us with international translation (mostly German, Spanish and French). Please, contact me at if you could help.

Document by: Alexey Rybak, Lioubov Vereschagina, Vladimir Krivosheev
Feedback: contact developers and users through the mailing list (blitz-subscribe aT alexeyrybak d0t com) or visit the BugTraker

This is full documentation. Blitz also has a very short geek tutorial which can save you time.

null

看: http://alexeyrybak.com/blitz/blitz_en.html
http://template-bench.iliakantor.ru/

增加 NFS 守护程序的数量

星期六, 1月 26th, 2008

增加 NFS 守护程序的数量。
默认地,标准的 CSM 扇出值为 16。这意味着跨集群运行的命令会一次运行 16 个节点,节点安装也是如此。Red Hat Linux 的标准 NFS 设置是 8 个可同时运行的守护程序。您可以扩展 NFS,方法是增加 NFSD 线程数到 16 以匹配默认的 CSM 扇出值。如果增加扇出值,您可能也会想增加 NFS 的线程数。一般地,扇出值为 32、NFS 线程数为 32 对于保证速度和可靠性已经足够,而且还能允许同时安装具 32 节点的单个 rack。要实现这一目的,创建配置文件 /etc/sysconfig/nfs 并添加如下行:

[conf]
RPCNFSDCOUNT=16
[/conf]

增加 ARP 表大小和超时设置

星期六, 1月 26th, 2008

如果一个很大的网络的同一个子网上具有很多或全部集群,ARP 表就可能会过载,就会让人觉得网络请求的响应速度太慢。为了避免上述现象,需要对运行中的系统做如下更改,并将这些更改添加到 /etc/sysctl.conf 文件,以使更改能够持久有效:

[conf]
net.ipv4.conf.all.arp_filter = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.neigh.default.gc_thresh1 = 512
net.ipv4.neigh.default.gc_thresh2 = 2048
net.ipv4.neigh.default.gc_thresh3 = 4096
net.ipv4.neigh.default.gc_stale_time = 240
[/conf]

msn人数

星期五, 1月 25th, 2008

刚才统计了一下我MSN上的人数,除去我自己的另外2个MSN帐号,共:841,FT..

Linux内核参数-与磁盘IO子系统有关的

星期四, 1月 17th, 2008

/proc/sys/vm/dirty_ratio

这个参数控制文件系统的文件系统写缓冲区的大小,单位是百分比,表示系统内存的百分比,表示当写缓冲使用到系统内存多少的时候,开始向磁盘写出数据。增大之会使用更多系统内存用于磁盘写缓冲,也可以极大提高系统的写性能。但是,当你需要持续、恒定的写入场合时,应该降低其数值,一般启动上缺省是 10。下面是增大的方法:

echo ‘40′ > /proc/sys/vm/dirty_ratio

(more…)

一个php写的计算网段mask的函数

星期三, 1月 16th, 2008

感谢钱同事!

[php]
< ?php
$ipEnd="211.138.224.0";
$ipStart="211.138.239.255";

$res=getRegionIPV4($ipStart,$ipEnd);

echo $ipStart,"/",$res;

function getRegionIPV4(&$ipStart,&$ipEnd)
{
$ipStartL=ip2long($ipStart);
$ipEndL=ip2long($ipEnd);
$diff=$ipEndL-$ipStartL;

if($diff<0)
{
$diff=abs($diff);
$tmp=$ipStart;
$ipStart=$ipEnd;
$ipEnd=$tmp;
}
$diffMask=decbin($diff);
return 32-strlen($diffMask);
}
?>
[/php]
[shell]
php t.php
211.138.224.0/20
[/shell]

在线的.htaccess文件编辑器

星期二, 1月 8th, 2008

对于不熟编辑.htaccess文件的朋友有福了!
见这里:http://www.htaccesseditor.com/ 而且有中文语言哦:)