Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 72F631142F for ; Thu, 7 Aug 2014 20:05:14 +0000 (UTC) Received: (qmail 49923 invoked by uid 500); 7 Aug 2014 20:05:14 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 49867 invoked by uid 500); 7 Aug 2014 20:05:14 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 49844 invoked by uid 99); 7 Aug 2014 20:05:14 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2014 20:05:14 +0000 Date: Thu, 7 Aug 2014 20:05:14 +0000 (UTC) From: "Matteo Bertozzi (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-11598) Add simple rpc throttling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-11598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14089720#comment-14089720 ] Matteo Bertozzi commented on HBASE-11598: ----------------------------------------- switched to a two methods only: set_quota and list_quotas to add/replace/update a quota settings you use set_quota with all the options to tune the a particular quota type. {noformat} hbase> set_quota TYPE => THROTTLE, USER => 'bob', LIMIT => '10req/sec' hbase> set_quota TYPE => THROTTLE, USER => 'bob', TABLE => 't1', LIMIT => '64M/min' hbase> set_quota TYPE => THROTTLE, TABLE => 't2', LIMIT => '100req/sec' hbase> set_quota TYPE => THROTTLE, NAMESPACE => 'n1', LIMIT => '100M/min' {noformat} to remove something you just set the limit to NONE {noformat} hbase> set_quota TYPE => THROTTLE, USER => 'bob', LIMIT => NONE {noformat} To list the quotas you use the list_quotas (which is a scanner) and you get all the details. you can specify filters {noformat} hbase> list_quotas OWNER QUOTAS NAMESPACE => n1 {TYPE => THROTTLE, THROTTLE_TYPE => REQUEST_SIZE, LIMIT => 100M/min, SCOPE =>MACHINE} TABLE => t2 {TYPE => THROTTLE, THROTTLE_TYPE => REQUEST_NUMBER, LIMIT => 100req/sec, SCOPE => MACHINE} USER => bob {TYPE => THROTTLE, THROTTLE_TYPE => REQUEST_NUMBER, LIMIT => 10req/sec, SCOPE => MACHINE} USER => bob, TABLE => t1 {TYPE => THROTTLE, THROTTLE_TYPE => REQUEST_SIZE, LIMIT => 64M/min, SCOPE => MACHINE} 4 row(s) in 0.1360 seconds hbase> list_quotas USER => 'bo.*' OWNER QUOTAS USER => bob {TYPE => THROTTLE, THROTTLE_TYPE => REQUEST_NUMBER, LIMIT => 10req/sec, SCOPE => MACHINE} USER => bob, TABLE => t1 {TYPE => THROTTLE, THROTTLE_TYPE => REQUEST_SIZE, LIMIT => 64M/min, SCOPE => MACHINE} 2 row(s) in 0.0210 seconds {noformat} > Add simple rpc throttling > ------------------------- > > Key: HBASE-11598 > URL: https://issues.apache.org/jira/browse/HBASE-11598 > Project: HBase > Issue Type: New Feature > Reporter: Matteo Bertozzi > Assignee: Matteo Bertozzi > Priority: Minor > Fix For: 1.0.0, 2.0.0 > > > Add a simple version of rpc throttling. > (by simple I mean something that requires less changes as possible to the core) > The idea is to add a hbase:quota table to store the user/table quota information. > Add a couple of API on the client like throttleUser() and throttleTable() > and on the server side before executing the request we check the quota, if not an exception is thrown. > The quota will be per-machine. There will be a flag "QuotaScope" that will be used in the future to specify the quota at "cluster level" instead of per machine. (A limit of 100req/min means that each machine can execute 100req/min with a scope per-machine). > This will be the first cut, simple solution that requires verify few changes to the core. > Later on we can make the client aware of the ThrottlingException and deal with it in a smarter way. > Also we need to change a bit the RPC code to be able to yield the operation if the quota will be > available not to far in the future, and avoid going back to the client for "few seconds". > REVIEW BOARD: https://reviews.apache.org/r/23981 -- This message was sent by Atlassian JIRA (v6.2#6252)