2012年5月24日 星期四

Linux : ulimit


ulimit [-SHacdfltu]

選項與參數:
-H  :hard limit ,嚴格的設定,必定不能超過這個設定的數值;
-S  :soft limit ,警告的設定,可以超過這個設定值,但是若超過則有警告訊息。
      在設定上,通常 soft 會比 hard 小,舉例來說,soft 可設定為 80 而 hard
      設定為 100,那麼你可以使用到 90 (因為沒有超過 100),但介於 80~100 之間時,
      系統會有警告訊息通知你!
-a  :後面不接任何選項與參數,可列出所有的限制額度;
-c  :當某些程式發生錯誤時,系統可能會將該程式在記憶體中的資訊寫成檔案(除錯用),
      這種檔案就被稱為核心檔案(core file)。此為限制每個核心檔案的最大容量。
-f  :此 shell 可以建立的最大檔案容量(一般可能設定為 2GB)單位為 Kbytes
-d  :程序可使用的最大斷裂記憶體(segment)容量;
-l  :可用於鎖定 (lock) 的記憶體量
-t  :可使用的最大 CPU 時間 (單位為秒)
-u  :單一使用者可以使用的最大程序(process)數量。

from Linux Vbird

zone_reclaim_mode


zone_reclaim_mode:

Zone_reclaim_mode allows someone to set more or less aggressive approaches to
reclaim memory when a zone runs out of memory. If it is set to zero then no
zone reclaim occurs. Allocations will be satisfied from other zones / nodes
n the system.

This is value ORed together of

1 = Zone reclaim on
2 = Zone reclaim writes dirty pages out
4 = Zone reclaim swaps pages

zone_reclaim_mode is set during bootup to 1 if it is determined that pages from remote zones will cause a measurable performance reduction. The page allocator will then reclaim easily reusable pages (those page
cache pages that are currently not used) before allocating off node pages.

It may be beneficial to switch off zone reclaim if the system is used for a file server and all of memory should be used for caching files from disk. In that case the caching effect is more important than data locality.

Allowing zone reclaim to write out pages stops processes that are writing large amounts of data from dirtying pages on other nodes. Zone reclaim will write out dirty pages if a zone fills up and so effectively throttle the process. This may decrease the performance of a single process since it cannot use all of system memory to buffer the outgoing writes anymore but it preserve the memory on other nodes so that the performance
of other processes running on other nodes will not be affected.

Allowing regular swap effectively restricts allocations to the local node unless explicitly overridden by memory policies or cpuset configurations.

2012年5月23日 星期三

[WIN7] USB裝置無法辨識 更新驅動程式又發生錯誤

今天USB滑鼠出現這個問題
離開座位,一回來後滑鼠不會動,而且重新拔插後,就出現了 "USB裝置無法辨識"
最後.就用下面方法解決

重開機時, 按F8進入安全模式,到裝置管理員中,將"所有"的通用序列匯流排控制器下的裝置,全部解除安裝,重新開機

2012年5月16日 星期三

NIC Bonding on RHEL 6

0. Stop the Network Manager 

If you have install Network Manager package.
Please stop it first.

# chkconfig NetworkManager off
# /etc/init.d/NetworkManager stop

1. Create bonding.conf


# vim /etc/modprobe.d/bonding.conf
alias bond0 bonding

2. Create 3 file under /etc/sysconfig/network-scripts/

===File: ifcfg-eth0===
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

===File: ifcfg-eth1===
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

===File: ifcfg-bond0===
DEVICE=bond0
IPADDR=192.168.0.126
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
BONDING_OPTS="miimon=1000 mode=active-backup"

3. Make sure you specify all required parameters

It is essential that both arp_interval and arp_ip_target parameters are specified, or, alternatively, the miimon parameter is specified. Failure to do so can cause degradation of network performance in the event that a link fails.

* arp_interval
 If using this setting while in mode 0 or 2 (the two load-balancing modes), the network switch must be configured to distribute packets evenly across the NICs. For more information on how to accomplish this, refer to  /usr/share/doc/kernel-doc-/Documentation/networking/ bonding.txt

* arp_ip_target
 Specifies the target IP address of ARP requests when the arp_interval parameter is enabled. Up to 16 IP addresses can be specified in a comma separated list

4. Mode Value

mode= 
Allows you to specify the bonding policy. The can be one of:

*balance-rr or 0
 Sets a round-robin policy for fault tolerance and load balancing. Transmissions are received and sent out sequentially on each bonded slave interface beginning with the first one available.

*active-backup or 1
 Sets an active-backup policy for fault tolerance. Transmissions are received and sent out via the first available bonded slave interface. Another bonded slave interface is only used if the active bonded slave interface fails.

*balance-xor or 2
Sets an XOR (exclusive-or) policy for fault tolerance and load balancing. Using this method, the interface matches up the incoming request's MAC address with the MAC address for one of the slave NICs. Once this link is established, transmissions are sent out sequentially beginning with the first available interface.

*broadcast or 3
Sets a broadcast policy for fault tolerance. All transmissions are sent on all slave interfaces.

*802.3ad or 4
Sets an IEEE 802.3ad dynamic link aggregation policy. Creates aggregation groups that share the same speed and duplex settings. Transmits and receives on all slaves in the active aggregator. Requires a switch that is 802.3ad compliant.

*balance-tlb or 5
Sets a Transmit Load Balancing (TLB) policy for fault tolerance and load balancing. The outgoing traffic is distributed according to the current load on each slave interface. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed slave.

*balance-alb or 6
Sets an Active Load Balancing (ALB) policy for fault tolerance and load balancing. Includes transmit and receive load balancing for IPV4 traffic. Receive load balancing is achieved through ARP negotiation.

reference : RHEL 6 : 24.7.2. Using Channel Bonding