Skip to content

Commit

Permalink
pool: dedicated port range for nfs
Browse files Browse the repository at this point in the history
Linux client will keep a rpc task with a hope
that server will be back. As we randomly select
tcp port number, the kernel task will stay
for ever in a D state and bump CPU load by one.

adds new properties:

pool.mover.nfs.port.min
pool.mover.nfs.port.max

a best practice will be dedicated port per pool.

Acked-by: Paul MIllar
Acked-by: Gerd Behrmann
Target: master, 2.12, 2.11, 2.10
Require-book: no
Require-notes: no
  • Loading branch information
kofemann committed Jun 15, 2015
1 parent 9248f25 commit f1ec21a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,13 @@ public class NfsTransferService extends AbstractCellComponent
private final long _bootVerifier = System.currentTimeMillis();
private boolean _sortMultipathList;

public void init() throws IOException, GSSException, OncRpcException {
private int _minTcpPort;
private int _maxTcpPort;

String dcachePorts = System.getProperty("org.dcache.net.tcp.portrange");
PortRange portRange;
if (dcachePorts != null) {
portRange = PortRange.valueOf(dcachePorts);
} else {
portRange = new PortRange(0);
}
public void init() throws IOException, GSSException, OncRpcException {

_door = new CellStub(getCellEndpoint());
PortRange portRange = new PortRange(_minTcpPort, _maxTcpPort);
_nfsIO = new NFSv4MoverHandler(portRange, _withGss, getCellName(), _door, _bootVerifier);
_localSocketAddresses = localSocketAddresses(NetworkUtils.getLocalAddresses(), _nfsIO.getLocalAddress().getPort());

Expand All @@ -96,6 +92,16 @@ public void setPostTransferService(PostTransferService postTransferService) {
_postTransferService = postTransferService;
}

@Required
public void setMinTcpPort(int minPort) {
_minTcpPort = minPort;
}

@Required
public void setMaxTcpPort(int maxPort) {
_maxTcpPort = maxPort;
}

public void shutdown() throws IOException {
_nfsIO.shutdown();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@
<property name="enableGss" value="${pool.mover.nfs.rpcsec_gss}" />
<property name="postTransferService" ref="post-transfer-service"/>
<property name="faultListener" ref="pool"/>
<property name="minTcpPort" value="${pool.mover.nfs.port.min}"/>
<property name="maxTcpPort" value="${pool.mover.nfs.port.max}"/>
</bean>

<bean id="xrootd-transfer-service" class="org.dcache.xrootd.pool.XrootdTransferService"
Expand Down
10 changes: 10 additions & 0 deletions skel/share/defaults/pool.properties
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@ pool.plugins.sweeper=${sweeper}
#
(one-of?true|false)pool.mover.nfs.rpcsec_gss = false

# ---- NFS mover port range
#
# This option controls TCP port range used by NFS mover. In most
# cases we would like to reduce the range to a single port to
# let client to reconnect. If client failed to reconnect to the
# mover, then a RPC request may stay in clients task queue in a
# 'D' state and increase CPU load by one.
pool.mover.nfs.port.min = ${dcache.net.lan.port.min}
pool.mover.nfs.port.max = ${dcache.net.lan.port.max}

# ---- Port used for passive DCAP movers
#
# When zero then a random port from the LAN port range is used.
Expand Down
2 changes: 2 additions & 0 deletions skel/share/services/nfs.batch
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ check -strong nfs.db.connections.max
check -strong nfs.namespace-cache.time
check -strong nfs.namespace-cache.time.unit
check -strong nfs.namespace-cache.size
check -strong pool.mover.nfs.port.min
check -strong pool.mover.nfs.port.max
check nfs.db.password
check nfs.db.password.file
check nfs.domain
Expand Down

0 comments on commit f1ec21a

Please sign in to comment.