Managing user rate limits

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

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 users after setting the value of rate limits by using the radosgw-admin ratelimit set command with the ratelimit-scope set as user.

Procedure

  1. Set the rate limit for the user.
    radosgw-admin ratelimit set --ratelimit-scope=user --uid=USER_ID [--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=user --uid=testing --max-read-ops=1024 --max-write-bytes=10240
  2. Get the user rate limit.
    radosgw-admin ratelimit get --ratelimit-scope=user --uid=USER_ID
    For example,
    [ceph: root@host01 /]# radosgw-admin ratelimit get --ratelimit-scope=user --uid=testing
    
    {
        "user_ratelimit": {
            "max_read_ops": 1024,
            "max_write_ops": 0,
            "max_read_bytes": 0,
            "max_write_bytes": 10240,
            "enabled": false
        }
    }
  3. Enable the user rate limit.
    radosgw-admin ratelimit enable --ratelimit-scope=user --uid=_USER_ID
    For example,
    [ceph: root@host01 /]# radosgw-admin ratelimit enable --ratelimit-scope=user --uid=testing
    
    {
        "user_ratelimit": {
            "max_read_ops": 1024,
            "max_write_ops": 0,
            "max_read_bytes": 0,
            "max_write_bytes": 10240,
            "enabled": true
        }
    }

Disabling user rate limits

Procedure

Disable user rate limits by running the ratelimit disable command.
radosgw-admin ratelimit disable --ratelimit-scope=user --uid=USER_ID
For example,
[ceph: root@host01 /]# radosgw-admin ratelimit disable --ratelimit-scope=user --uid=testing