Using Apache HBase to store and access data
Also available as:
PDF
loading table of contents...

Throttle quota examples

Following examples details the usage of adding throttle quotas commands, listing throttle quotas commands, and updating and deleting throttle quotas commands.

Examples of Adding Throttle Quotas Commands

Limit user u1 to 10 requests per second globally:

hbase> set_quota => TYPE => THROTTLE, USER => 'u1', LIMIT => '10req/sec'

Limit user u1 to up to 10MB of traffic per second globally:

hbase> set_quota => TYPE => THROTTLE, USER => 'u1', LIMIT => '10M/sec'

Limit user u1 to 10 requests/second globally for read operations. User u1 can still issue unlimited writes:

hbase> set_quota TYPE => THROTTLE, THROTTLE_TYPE => READ, USER => 'u1', LIMIT => '10req/sec'

Limit user u1 to 10 requests/second globally for read operations. User u1 can still issue unlimited reads:

hbase> set_quota TYPE => THROTTLE, THROTTLE_TYPE => WRITE, USER => 'u1', LIMIT => '10M/sec'

Limit user u1 to 5 KB/second for all operations on table t2. User u1 can still issue unlimited requests for other tables, regardless of type of operation:

hbase> set_quota TYPE => THROTTLE, USER => 'u1', TABLE => 't2', LIMIT => '5K/min'

Limit request to namespaces:

hbase> set_quota TYPE => THROTTLE, NAMESPACE => 'ns1', LIMIT => '10req/sec'

Limit request to tables:

hbase> set_quota TYPE => THROTTLE, TABLE => 't1', LIMIT => '10M/sec'

Limit requests based on type, regardless of users, namespaces, or tables:

hbase> set_quota TYPE => THROTTLE, THROTTLE_TYPE => WRITE, TABLE => 't1', LIMIT => '10M/sec'

Examples of Listing Throttle Quotas Commands

Show all quotas:

hbase> list_quotas

Show all quotas applied to user bob:

hbase> list_quotas USER => 'bob.*'

Show all quotas applied to user bob and filter by table or namespace:

hbase> list_quotas USER => 'bob.*', TABLE => 't1'
hbase> list_quotas USER => 'bob.*', NAMESPACE => 'ns.*'

Show all quotas and filter by table or namespace:

hbase> list_quotas TABLE => 'myTable'
hbase> list_quotas NAMESPACE => 'ns.*'

Examples of Updating and Deleting Throttle Quotas Commands

To update a quota, simply issue a new set_quota command. To remove a quota, you can set LIMIT to NONE. The actual quota entry will not be removed, but the policy will be disabled.

hbase> set_quota TYPE => THROTTLE, USER => 'u1', LIMIT => NONE
hbase> set_quota TYPE => THROTTLE, USER => 'u1', NAMESPACE => 'ns2', LIMIT => NONE
hbase> set_quota TYPE => THROTTLE, THROTTLE_TYPE => WRITE, USER => 'u1', LIMIT => NONE
hbase> set_quota USER => 'u1', GLOBAL_BYPASS => true