Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1394524
  • 博文数量: 343
  • 博客积分: 13098
  • 博客等级: 上将
  • 技术积分: 2862
  • 用 户 组: 普通用户
  • 注册时间: 2005-07-06 00:35
文章存档

2012年(131)

2011年(31)

2010年(53)

2009年(23)

2008年(62)

2007年(2)

2006年(36)

2005年(5)

分类: 虚拟化

2012-06-02 23:04:25

NFS Locking
NFS locking on ESX does not use the NLM protocol. VMware has its own locking protocol. NFS locks are implemented by creating lock files on the NFS server. Lock files are named .lck-, where is the value of the fileid field returned from a GETATTR request for the file being locking. When a lock file is created an update is periodically (every NFS.DiskFileLockUpdateFreq seconds) sent to the lock file to let other ESX hosts know that the lock is still active. The lock file updates generate small (84 byte) WRITE requests to the NFS server. Changing any of the NFS locking parameters changes how long it takes to recover stale locks. This formula can be used to calculate how long it takes to recover a stale NFS lock:
(NFS.DiskFileLockUpdateFreq * NFS.LockRenewMaxFailureNumber) + NFS.LockUpdateTimeout

This example demonstrates the above equation using the default values in VMware ESX 3.5:

X is the length of time it takes to recover from a stale NFS lock.
X = (NFS.DiskFileLockUpdateFreq * NFS.LockRenewMaxFailureNumber) + NFS.LockUpdateTimeout
X = (10 * 3) + 5
X = 35 seconds

If any of these parameters are modified it is very important that all ESX hosts in the cluster use identical settings. Having inconsistent NFS lock settings across ESX hosts can result in data corruption.

NFS Heartbeats
NFS heartbeats are used to determine whether or not an NFS volume is still available. NFS heartbeats are actually GETATTR requests on the root file handle of the NFS Volume. There is a system world that runs every NFS.HeartbeatFrequency seconds to check if it needs to issue heartbeat requests for any of the NFS volumes. If a volume is marked available, it only issue a heartbeat if it has been NFS.HeartBeatDelta seconds since it issued a successful GETATTR (not necessarily a heartbeat GETATTR) for that volume. The NFS heartbeat world always issues heartbeats for NFS volumes which are marked unavailable. Here is the formula to calculate how long it can take ESX to mark an NFS volume as unavailable:

RoundUp(NFS.HeartbeatDelta, NFS.HeartbeatFrequency) + (NFS.HeartbeatFrequency * (NFS.HeartbeatMaxFailures - 1)) + NFS.HeartbeatTimeout
This example demonstrates the above equation using the default values in VMware ESX 3.5:

Y is the length of time it takes to mark a volume as not available.
Y = RoundUp( NFS.HeartbeatDelta, NFS.HeartbeatFrequency ) + (NFS.HeartbeatFrequency * (NFS.HeartbeatMaxFailures - 1)) + NFS.HeartbeatTimeout
Y = RoundUp( 5, 9 ) + ( 9 * ( 3 - 1 ) ) + 5
Y = 5 + ( 9 * ( 3 - 1 ) ) + 5
Y = 28 seconds

When a volume is back up, it can take NFS.HeartbeatFrequency seconds before ESX marks the volume as available.
Note: For more information about the roundup operation, see . Note, the order in which the twp values may be reversed depending on the implementation of the RoundUp operation.
阅读(1057) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~