[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 3

lockd Daemon

Purpose

Processes lock requests.

Syntax

/usr/sbin/rpc.lockd [ -a NumberOfThreads ][ -t TimeOut ] [ -g GracePeriod ]

Description

The lockd daemon processes lock requests that are either sent locally by the kernel or remotely by another lock daemon. The lockd daemon forwards lock requests for remote data to the server site lock daemon through the RPC package. The lockd daemon then asks the statd (status monitor) daemon for monitor service. The reply to the lock request is not sent to the kernel until both the statd daemon and the server site lockd daemon reply. The statd daemon should always be started before the lockd daemon.

If either the status monitor or the server site lock daemon is unavailable, the reply to a lock request for remote data is delayed until all daemons become available.

When a server recovers, it waits for a grace period for all client site lockd daemons to submit reclaim requests. The client site lockd daemons, on the other hand, are notified of the server recovery by the statd daemon. These daemons promptly resubmit previously granted lock requests. If a lockd daemon fails to secure a previously granted lock at the server site, the lockd daemon sends a SIGLOST signal to the process.

The lockd daemon is started and stopped with the following System Resource Controller (SRC) commands:

startsrc -s rpc.lockd
stopsrc -s rpc.lockd

To modify the arguments passed to the lockd daemon when it is started, use the following command:

chssys -s rpc.lockd Parameters...

The status monitor maintains information on the location of connections as well as the status in the /etc/sm directory, the /etc/sm.bak file, and the /etc/state file. When restarted, the statd daemon queries these files and tries to reestablish the connection it had prior to termination. To restart the statd daemon, and subsequently the lockd daemon, without prior knowledge of existing locks or status, delete these files before restarting the statd daemon.

Flags

-a NumberOfThreads Specifies the maximum number of rpc.lockd threads. This can be useful on an NFS file system because all the lockf() or flock() calls (and other file locking calls) must go through the rpc.lockd daemon. This can severely degrade system performance because the lock daemon might not be able to handle thousands of lock requests per second. When a large number of concurrent processes are forked from a single script, the rpc.lockd value increases to the default maximum of 33. After the maximum rpc.lockd value is reached, any other lock requests must wait for the lockd for processing. This wait causes a recurring cycle of TCP timeouts thus allowing only one individual forked process to complete each cycle. The solution to this problem is to increase the maximum allowed number of rpc.lockd threads. This can be done with the following command:
startsrc -s rpc.lockd -a NumberOfThreads (511 max.)
or in the ODM with:
chssys -s rpc.lockd -a NumberOfThreads (511 max.)

-g GracePeriod Uses the GracePeriod variable to specify the amount of time, in seconds, that the lockd daemon should wait for reclaim requests for previously granted locks. The default value of the GracePeriod variable is 45 seconds.
-t TimeOut Uses the TimeOut variable to specify the interval between retransmitting lock requests to the remote server. The default value for the TimeOut variable is 15 seconds.

Examples

  1. To specify a grace period, enter:
    /usr/sbin/rpc.lockd -g 60
    In this example, the grace period is set for 60 seconds.
  2. To specify the amount of time the lockd daemon should wait before retransmitting a lock request, enter:
    /usr/sbin/rpc.lockd -t 30
    In this example, the retransmissions occur after 30 seconds.

Related Information

The chssys command, nfso command, no command.

The statd daemon.

The fcntl subroutine, lockf subroutine, signal subroutine.

List of NFS Commands.

Network File System (NFS) Overview for System Management in AIX 5L Version 5.2 System Management Guide: Communications and Networks.

AIX 5L Version 5.2 Performance Management Guide.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]