Managing global rate limits

You can read or write global rate limit settings in period configuration.

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.

About this task

You can override the user or bucket rate limit configuration by manipulating the global rate limit settings with the global ratelimit parameter, which is the counterpart of ratelimit set, ratelimit enable, and ratelimit disable commands.

Note: In a multi-site configuration, where there is a realm and period present, changes to the global rate limit must be committed using period update --commit command. If there is no period present, the Ceph Object Gateways must be restarted for the changes to take effect.

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. Get the global rate limit.
    radosgw-admin global ratelimit get
    For example,
    [ceph: root@host01 /]# radosgw-admin global ratelimit get
    
    {
        "bucket_ratelimit": {
            "max_read_ops": 1024,
            "max_write_ops": 0,
            "max_read_bytes": 0,
            "max_write_bytes": 0,
            "enabled": false
        },
        "user_ratelimit": {
            "max_read_ops": 0,
            "max_write_ops": 0,
            "max_read_bytes": 0,
            "max_write_bytes": 0,
            "enabled": false
        },
        "anonymous_ratelimit": {
            "max_read_ops": 0,
            "max_write_ops": 0,
            "max_read_bytes": 0,
            "max_write_bytes": 0,
            "enabled": false
        }
    }
  2. Configure and enable rate limit scope for the buckets.
    1. Set the global rate limits for bucket.
      radosgw-admin global ratelimit set --ratelimit-scope=bucket [--max-read-ops=NUMBER_OF_OPERATIONS] [--max-read-bytes=NUMBER_OF_BYTES][--max-write-ops=NUMBER_OF_OPERATIONS] [--max-write-bytes=NUMBER_OF_BYTES]
      For example,
      [ceph: root@host01 /]# radosgw-admin global ratelimit set --ratelimit-scope bucket --max-read-ops=1024
    2. Enable the bucket rate limit.
      radosgw-admin global ratelimit enable --ratelimit-scope=bucket
      For example,
      [ceph: root@host01 /]# radosgw-admin global ratelimit enable --ratelimit-scope bucket
  3. Configure and enable rate limit scope for authenticated users.
    1. Set the global rate limits for users.
      radosgw-admin global ratelimit set --ratelimit-scope=user [--max-read-ops=NUMBER_OF_OPERATIONS] [--max-read-bytes=NUMBER_OF_BYTES][--max-write-ops=NUMBER_OF_OPERATIONS] [--max-write-bytes=NUMBER_OF_BYTES]
      For example,
      [ceph: root@host01 /]# radosgw-admin global ratelimit set --ratelimit-scope=user --max-read-ops=1024
    2. Enable the user rate limit.
      radosgw-admin global ratelimit enable --ratelimit-scope=user
      For example,
      [ceph: root@host01 /]# radosgw-admin global ratelimit enable --ratelimit-scope=user
  4. Configure and enable rate limit scope for unauthenticated users.
    1. Set the global rate limits for unauthenticated users.
      radosgw-admin global ratelimit set --ratelimit-scope=anonymous [--max-read-ops=NUMBER_OF_OPERATIONS] [--max-read-bytes=NUMBER_OF_BYTES][--max-write-ops=NUMBER_OF_OPERATIONS] [--max-write-bytes=NUMBER_OF_BYTES]
      For example,
      [ceph: root@host01 /]# radosgw-admin global ratelimit set --ratelimit-scope=anonymous --max-read-ops=1024
    2. Enable the user rate limit.
      radosgw-admin global ratelimit enable --ratelimit-scope=anonymous
      For example,
      [ceph: root@host01 /]# radosgw-admin global ratelimit enable --ratelimit-scope=anonymous