Managing bucket rate limits

You can set rate limits on buckets in a Ceph Object Gateway configuration. The rate limit on buckets include the maximum number of read operations, write operations per minute, and how many bytes per minute can be written or read per bucket.

Before you begin

Before you begin, make sure that you have the following prerequisites in place:
  • A running IBM Storage Ceph cluster.
  • A Ceph Object Gateway installed.

Enabling user rate limits

About this task

You can enable the rate limit on buckets after setting the value of rate limits by using the radosgw-admin ratelimit set command with the ratelimit-scope set as bucket.

Procedure

  1. Set the rate limit for the bucket.
    radosgw-admin ratelimit set --ratelimit-scope=bucket --bucket=BUCKET_NAME [--max-read-ops=NUMBER_OF_OPERATIONS] [--max-read-bytes=NUMBER_OF_BYTES][--max-write-ops=NUMBER_OF_OPERATIONS] [--max-write-bytes=NUMBER_OF_BYTES]

    Inputting a value of 0 for NUMBER_OF_OPERATIONS or NUMBER_OF_BYTES disables that specific rate limit attribute check.

    For example,
    [ceph: root@host01 /]# radosgw-admin ratelimit set --ratelimit-scope=bucket --bucket=mybucket --max-read-ops=1024 --max-write-bytes=10240
  2. Get the bucket rate limit.
    radosgw-admin ratelimit get --ratelimit-scope=bucket --bucket=BUCKET_NAME
    For example,
    [ceph: root@host01 /]# radosgw-admin ratelimit get --ratelimit-scope=bucket --bucket=mybucket
    
    {
        "bucket_ratelimit": {
            "max_read_ops": 1024,
            "max_write_ops": 0,
            "max_read_bytes": 0,
            "max_write_bytes": 10240,
            "enabled": false
        }
    }
  3. Enable the bucket rate limit.
    radosgw-admin ratelimit enable --ratelimit-scope=bucket --bucket=BUCKET_NAME
    For example,
    [ceph: root@host01 /]# radosgw-admin ratelimit enable --ratelimit-scope=bucket --bucket=mybucket
    
    {
        "bucket_ratelimit": {
            "max_read_ops": 1024,
            "max_write_ops": 0,
            "max_read_bytes": 0,
            "max_write_bytes": 10240,
            "enabled": true
        }
    }

Disabling the bucket rate limits

Procedure

Disable bucket rate limits by running the ratelimit disable command.
radosgw-admin ratelimit disable --ratelimit-scope=bucket --bucket=BUCKET_NAME
For example,
[ceph: root@host01 /]# radosgw-admin ratelimit disable --ratelimit-scope=bucket --bucket=mybucket