hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiroshi Ikeda (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-14331) a single callQueue related improvements
Date Fri, 11 Sep 2015 06:24:46 GMT

    [ https://issues.apache.org/jira/browse/HBASE-14331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14740280#comment-14740280

Hiroshi Ikeda commented on HBASE-14331:

That seems a mere bug.

  public long getDeadline(RequestHeader header, Message param) {
    String methodName = header.getMethodName();
    if (methodName.equalsIgnoreCase("scan")) {
      ScanRequest request = (ScanRequest)param;
      if (!request.hasScannerId()) {
        return 0;

      // get the 'virtual time' of the scanner, and applies sqrt() to get a
      // nice curve for the delay. More a scanner is used the less priority it gets.
      // The weight is used to have more control on the delay.
      long vtime = rpcServices.getScannerVirtualTime(request.getScannerId());
      return Math.round(Math.sqrt(vtime * scanVirtualTimeWeight));
    return 0;

> long vtime = rpcServices.getScannerVirtualTime(request.getScannerId());

doesn't give the 'virtual time' for the request. That should be:

long vtime = request.getNextCallSeq();

And It is subtle but seems not to be changed. (But I also feel that method is not so trivial
to be frequently used in a comparator...)

> a single callQueue related improvements
> ---------------------------------------
>                 Key: HBASE-14331
>                 URL: https://issues.apache.org/jira/browse/HBASE-14331
>             Project: HBase
>          Issue Type: Improvement
>          Components: IPC/RPC, Performance
>            Reporter: Hiroshi Ikeda
>            Assignee: Hiroshi Ikeda
>            Priority: Minor
>         Attachments: BlockingQueuesPerformanceTestApp-output.pdf, BlockingQueuesPerformanceTestApp-output.txt,
BlockingQueuesPerformanceTestApp.java, CallQueuePerformanceTestApp.java, HBASE-14331-V2.patch,
HBASE-14331-V3.patch, HBASE-14331.patch, HBASE-14331.patch, SemaphoreBasedBlockingQueue.java,
SemaphoreBasedLinkedBlockingQueue.java, SemaphoreBasedPriorityBlockingQueue.java
> {{LinkedBlockingQueue}} well separates locks between the {{take}} method and the {{put}}
method, but not between takers, and not between putters. These methods are implemented to
take locks at the almost beginning of their logic. HBASE-11355 introduces multiple call-queues
to reduce such possible congestion, but I doubt that it is required to stick to {{BlockingQueue}}.
> There are the other shortcomings of using {{BlockingQueue}}. When using multiple queues,
since {{BlockingQueue}} blocks threads it is required to prepare enough threads for each queue.
It is possible that there is a queue starving for threads while there is another queue where
threads are idle. Even if you can tune parameters to avoid such situations, the tuning is
not so trivial.
> I suggest using a single {{ConcurrentLinkedQueue}} with {{Semaphore}}.

This message was sent by Atlassian JIRA

View raw message