2013年5月25日 星期六

disable yum auto update on rhel 6


使用的開發版本為  scientific linux cern  &  scientific linux  ,都是基於 rhel 的開發版。

rhel 6 沒辦法像 5 一樣,使用 chkconfig --list|grep yum 看到的那種 update 來關閉
可以從下面兩個地方來做。讓系統不會在不知情之下,自動被更新。


# 直接把 autoupdate 移除
rpm -qa|grep yum|grep auto
yum-autoupdate-2-5.2.noarch

rpm -e yum-autoupdate-2-5.2.noarch

rpm -qa|grep yum-autoupdate




#或是在  /etc/sysconfig/yum-autoupdate 設定檔裡面加上 ENABLED="false"
sed -i '/ENABLED=/s/true/false/' /etc/sysconfig/yum-autoupdate

cat /etc/sysconfig/yum-autoupdate |grep -B5 'ENABLE'
# This file controls the configuration of yum-autoupdate
# For it to work as expected it should be /etc/sysconfig/yum-autoupdate
# ENABLED
#     true - Run yum-autoupdate
#     false - Do not run yum-autoupdate (default)
#   + anything other than true defaults to false
ENABLED="false"



修改 linux 時區設定



修改 linux 系統所使用的時區:
- 先到 /etc/sysconfig/clock 更改成想要的時區。
- 再從 /usr/share/zoneinfo 裡選擇要使用的時區,把檔案複製到 /etc/localtime (覆蓋原檔案)
- 可以再執行一次對時。已確認時間已校準正確。




date
Sat May 25 06:37:09 UTC 2013

cat /etc/sysconfig/clock
ZONE="UTC"

vim /etc/sysconfig/clock
# 把內容改成  ZONE="Asia/Taipei"

cp /usr/share/zoneinfo/Asia/Taipei /etc/localtime
cp: overwrite `/etc/localtime'? y

ntpdate <time_server>
# 可以使用國內幾個校時的伺服器
        tock.stdtime.gov.tw
 watch.stdtime.gov.tw
 time.stdtime.gov.tw
 clock.stdtime.gov.tw 
 tick.stdtime.gov.tw


date
Sat May 25 14:41:15 CST 2013



2013年5月21日 星期二

iperf test udp 網路效能


使用 iperf 測量網路的效能,這次通過 udp 來進行測試。
在server 端加上 -u  這個選項,並可以指定測試使用的 buffer size ( 使用 window size 的選項) .

iperf -s -p 9005 -u  -w 2048K

-s    server 模式
-p    指定port
-u    設定為 udp 模式
-w   設定 buffer size , 在 udp 測試的時候,這個選項用來設定 udp buffer size.
        (  這裡設定成 2MB, 預設448 KByte)


client 端設定可以藉由調整測試時使用的 bandwidth 及 len  這兩個選項,得以跑出不同的效果~

iperf -c server.host.tw  -p 9005 -i 1 -t 300 -u -w 2048K -b 17400M -l 20700

-c      client 模式,並指定 server hostname
-p     指定 port
-i       輸出的時間間隔
-t      測試要跑多久(單位: 秒)
-u     指定 udp 模式
-w    同 server 端, udp buffer size
-b     設定 bandwidth ( 單位: bits/sec) 。
         加大時應注意 packet loss 的情況,packet loss 太大的話,測試就沒什麼意義了。
-l      len 大小設定。如果要針對 packet forward 的能力測試時,可以把它調小
         然後用多台client 同時對上一台 server 做壓力測試。




EX:
##command
server#  iperf -s -p 9005 -u -w 2048K
client#  iperf -c server.host.tw  -p 9005 -i 10 -t 30 -u -b 17400M -w 2048K -l 20700

##output

[root@client iperf-2.0.5]# iperf -c server.hostname -p 9005 -i10 -t30 -u -b 17400M -w2048K -l20700
------------------------------------------------------------
Client connecting to XXXXXXX, UDP port 9005
Sending 20700 byte datagrams
UDP buffer size: 448 KByte (WARNING: requested 2.00 MByte)
------------------------------------------------------------
[ 3] local XXX.XXX.XXX.XXX port 44717 connected with XXX.XXX.XXX.XXX port 9005
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 11.5 GBytes 9.91 Gbits/sec
[ 3] 10.0-20.0 sec 11.5 GBytes 9.91 Gbits/sec
[ 3] 0.0-30.0 sec 34.6 GBytes 9.91 Gbits/sec
[ 3] Sent 1795766 datagrams
[ 3] Server Report:
[ 3] 0.0-30.0 sec 2.46 GBytes 704 Mbits/sec 0.016 ms 635/1795765 (0.035%)
[ 3] 0.0-30.0 sec 19 datagrams received out-of-order

============
測試時可以使用 sar 來同時監看網路情況, ( 結尾 2 表示兩秒輸出一次)
sar -n DEV 2
rxpck/s   每秒收到幾個封包
rxkB/s     每秒收到幾kBytes


07:32:02 PM     IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
07:32:04 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
07:32:04 PM       em2      0.00      0.00      0.00      0.00      0.00      0.00      0.00
07:32:04 PM   rename3      0.00      0.00      0.00      0.00      0.00      0.00      0.00
07:32:04 PM      p2p1      2.00 179585.00      0.13 1216475.68      0.00      0.00      0.00
07:32:04 PM      p2p2      0.00      0.00      0.00      0.00      0.00      0.00      0.00




--
iperf 網路效能測試工具