[ 
https://issues.apache.org/jira/browse/HADOOP-13144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16388849#comment-16388849
 ] 

Íñigo Goiri commented on HADOOP-13144:
--------------------------------------

We see this issue in the Router as we are constrained by the number of 
connections.
The solution we internally have for this problem is to allow specifying the 
connection and the socket factory as in  [^HADOOP-13144.000.patch].
Then from {{ConnectionPool}} we can do:
{code}
  private static ConnectionContext newClientConnection(
      Configuration conf, String nnAddress, UserGroupInformation ugi, int index)
          throws IOException {
    RPC.setProtocolEngine(
        conf, ClientNamenodeProtocolPB.class, ProtobufRpcEngine.class);

    final RetryPolicy defaultPolicy = RetryUtils.getDefaultRetryPolicy(
        conf,
        DFSConfigKeys.DFS_CLIENT_RETRY_POLICY_ENABLED_KEY,
        DFSConfigKeys.DFS_CLIENT_RETRY_POLICY_ENABLED_DEFAULT,
        DFSConfigKeys.DFS_CLIENT_RETRY_POLICY_SPEC_KEY,
        DFSConfigKeys.DFS_CLIENT_RETRY_POLICY_SPEC_DEFAULT,
        SafeModeException.class);

    SocketFactory factory = SocketFactory.getDefault();
    if (UserGroupInformation.isSecurityEnabled()) {
      SaslRpcServer.init(conf);
    }
    InetSocketAddress socket = NetUtils.createSocketAddr(nnAddress);
    final long version = RPC.getProtocolVersion(ClientNamenodeProtocolPB.class);
    int timeout = org.apache.hadoop.ipc.Client.getTimeout(conf);
    FederationConnectionId connectionId = new FederationConnectionId(
        socket, ClientNamenodeProtocolPB.class, ugi, timeout, defaultPolicy,
        conf, index);
    ClientNamenodeProtocolPB proxy = RPC.getProtocolProxy(
        ClientNamenodeProtocolPB.class, version, connectionId, conf, factory)
            .getProxy();
    ClientProtocol client = new ClientNamenodeProtocolTranslatorPB(proxy);
    Text dtService = SecurityUtil.buildTokenService(socket);

    ProxyAndInfo<ClientProtocol> clientProxy =
        new ProxyAndInfo<ClientProtocol>(client, dtService, socket);
    ConnectionContext connection = new ConnectionContext(clientProxy);
    return connection;
  }
{code}

[~linyiqun], at some point you mentioned you had seen a similar issue.
Was the fix similar?

> Enhancing IPC client throughput via multiple connections per user
> -----------------------------------------------------------------
>
>                 Key: HADOOP-13144
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13144
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: ipc
>            Reporter: Jason Kace
>            Priority: Minor
>         Attachments: HADOOP-13144.000.patch
>
>
> The generic IPC client ({{org.apache.hadoop.ipc.Client}}) utilizes a single 
> connection thread for each {{ConnectionId}}.  The {{ConnectionId}} is unique 
> to the connection's remote address, ticket and protocol.  Each ConnectionId 
> is 1:1 mapped to a connection thread by the client via a map cache.
> The result is to serialize all IPC read/write activity through a single 
> thread for a each user/ticket + address.  If a single user makes repeated 
> calls (1k-100k/sec) to the same destination, the IPC client becomes a 
> bottleneck.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to