Skip to content

Commit dae572d

Browse files
mkogan1yuvalif
andcommitted
rgw: add rate limit for LIST & DELETE ops
Add rate limiting specific to LIST ops, similar to the current rate-limiting (https://docs.ceph.com/en/latest/radosgw/admin/#rate-limit-management) Example usage: ``` ./bin/radosgw-admin ratelimit set --ratelimit-scope=user --uid=<UID> --max_list_ops=2 ./bin/radosgw-admin ratelimit set --ratelimit-scope=user --uid=<UID> --max_delete_ops=2 ./bin/radosgw-admin ratelimit enable --ratelimit-scope=user --uid=<UID> ./bin/radosgw-admin ratelimit get --ratelimit-scope=user --uid=<UID> { "user_ratelimit": { "max_read_ops": 0, "max_write_ops": 0, "max_list_ops": 2, "max_delete_ops": 2, "max_read_bytes": 0, "max_write_bytes": 0, "enabled": true } } pkill -9 radosgw ./bin/radosgw -c ./ceph.conf ... aws --endpoint-url 'http://0:8000' s3 mb s3://bkt aws --endpoint-url 'http://0:8000' s3 cp ./ceph.conf s3://bkt aws --endpoint-url http://0:8000 s3api list-objects-v2 --bucket bkt --prefix 'ceph.conf' --delimiter '/' { "Contents": [ { "Key": "ceph.conf", "LastModified": "2025-07-30T13:59:38+00:00", "ETag": "\"13d11d431ae290134562c019d9e40c0e\"", "Size": 32346, "StorageClass": "STANDARD" } ], "RequestCharged": null } aws --endpoint-url http://0:8000 s3api list-objects-v2 --bucket bkt --prefix 'ceph.conf' --delimiter '/' { "Contents": [ { "Key": "ceph.conf", "LastModified": "2025-07-30T13:59:38+00:00", "ETag": "\"13d11d431ae290134562c019d9e40c0e\"", "Size": 32346, "StorageClass": "STANDARD" } ], "RequestCharged": null } aws --endpoint-url http://0:8000 s3api list-objects-v2 --bucket bkt --prefix 'ceph.conf' --delimiter '/' argument of type 'NoneType' is not iterable tail -F ./out/radosgw.8000.log | grep beast ... beast: 0x7fffbbe09780: [30/Jul/2025:15:44:50.359 +0000] " GET /bkt?list-type=2&delimiter=%2F&prefix=ceph.conf&encoding-type=url HTTP/1.1" 200 535 - "aws-cli/2.15.31 Python/3.9.21 Linux/5.14.0-570.28.1.el9_6.x86_64 source/x86_64.rhel.9 prompt/off command/s3api.list-objects-v2" - latency=0.000999995s beast: 0x7fffbbe09780: [30/Jul/2025:15:44:53.904 +0000] " GET /bkt?list-type=2&delimiter=%2F&prefix=ceph.conf&encoding-type=url HTTP/1.1" 200 535 - "aws-cli/2.15.31 Python/3.9.21 Linux/5.14.0-570.28.1.el9_6.x86_64 source/x86_64.rhel.9 prompt/off command/s3api.list-objects-v2" - latency=0.000999995s vvv beast: 0x7fffbbe09780: [30/Jul/2025:15:44:58.192 +0000] " GET /bkt?list-type=2&delimiter=%2F&prefix=ceph.conf&encoding-type=url HTTP/1.1" 503 228 - "aws-cli/2.15.31 Python/3.9.21 Linux/5.14.0-570.28.1.el9_6.x86_64 source/x86_64.rhel.9 prompt/off command/s3api.list-objects-v2" - latency=0.000000000s beast: 0x7fffbbe09780: [30/Jul/2025:15:44:58.798 +0000] " GET /bkt?list-type=2&delimiter=%2F&prefix=ceph.conf&encoding-type=url HTTP/1.1" 503 228 - "aws-cli/2.15.31 Python/3.9.21 Linux/5.14.0-570.28.1.el9_6.x86_64 source/x86_64.rhel.9 prompt/off command/s3api.list-objects-v2" - latency=0.000999994s beast: 0x7fffbbe09780: [30/Jul/2025:15:44:59.807 +0000] " GET /bkt?list-type=2&delimiter=%2F&prefix=ceph.conf&encoding-type=url HTTP/1.1" 503 228 - "aws-cli/2.15.31 Python/3.9.21 Linux/5.14.0-570.28.1.el9_6.x86_64 source/x86_64.rhel.9 prompt/off command/s3api.list-objects-v2" - latency=0.000000000s s3cmd put ./ceph.conf s3://bkt/1 s3cmd put ./ceph.conf s3://bkt/2 s3cmd put ./ceph.conf s3://bkt/3 s3cmd rm s3://bkt/1 s3cmd rm s3://bkt/2 s3cmd rm s3://bkt/3 delete: 's3://bkt/1' delete: 's3://bkt/2' WARNING: Retrying failed request: /3 (503 (SlowDown)) WARNING: Waiting 3 sec... WARNING: Retrying failed request: /3 (503 (SlowDown)) ^^^ ``` Fixes: https://tracker.ceph.com/issues/72894 Signed-off-by: Mark Kogan <[email protected]> Update PendingReleaseNotes Co-authored-by: Yuval Lifshitz <[email protected]> Signed-off-by: Mark Kogan <[email protected]> Update PendingReleaseNotes Co-authored-by: Yuval Lifshitz <[email protected]> Signed-off-by: Mark Kogan <[email protected]>
1 parent 6014f3a commit dae572d

File tree

15 files changed

+1100
-163
lines changed

15 files changed

+1100
-163
lines changed

PendingReleaseNotes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,13 @@ CephFS: Disallow delegating preallocated inode ranges to clients. Config
583583
* RGW: The serialized format of notification and topics has changed, so that
584584
new/updated topics will be unreadable by old RGWs. We recommend completing
585585
the RGW upgrades before creating or modifying any notification topics.
586+
* RGW: New rate limiting options have been added to control the number of
587+
bucket listing requests (`radosgw-admin ratelimit set ... --max-list-ops=`)
588+
and delete operations (`radosgw-admin ratelimit set ... --max-delete-ops=`)
589+
per accumulation interval, along with the ability to configure the
590+
accumulation interval duration (`rgw_ratelimit_interval`).
591+
Their default value is `0`, which keeps backward compatibility to the
592+
previous behavior of READ and WRITE operations rate limiting.
586593
* RBD: Trailing newline in passphrase files (`<passphrase-file>` argument in
587594
`rbd encryption format` command and `--encryption-passphrase-file` option
588595
in other commands) is no longer stripped.

doc/radosgw/admin.rst

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,21 @@ Rate Limit Management
622622
=====================
623623

624624
Quotas can be set for The Ceph Object Gateway on users and buckets. The "rate
625-
limit" includes the maximum number of read operations (read ops) and write
626-
operations (write ops) per minute as well as the number of bytes per minute
627-
that can be written or read per user or per bucket.
625+
limit" includes the maximum number of read operations and write operations
626+
per accumulation interval as well as the number of bytes per accumulation interval
627+
that can be written or read per user or per bucket. It also includes the maximum
628+
number of list requests and delete operations per accumulation interval.
629+
The accumulation interval is configured by the :confval:`rgw_ratelimit_interval` option.
630+
The default value is 60 seconds.
631+
(Note: S3 Multi-Object Delete operation are currently not supported by rate limiting)
632+
633+
The configured limits should be divided by the number of active object gateways. For example,
634+
if "user A" is to be be limited to 10 ops per minute and there are two object gateways in the cluster,
635+
then the limit on "user A" should be 5 (10 ops per minute / 2 RGWs).
636+
If the requests are not balanced between RGWs, the rate limit might be underutilized.
637+
For example: if the ops limit is 5 and there are two RGWs,
638+
but the Load Balancer sends load to only one of those RGWs,
639+
the effective limit is 5 ops, because this limit is enforced per RGW.
628640

629641
Read Requests and Write Requests
630642
--------------------------------
@@ -636,8 +648,8 @@ How Metrics Work
636648
Each object gateway tracks per-user metrics separately from bucket metrics.
637649
These metrics are not shared with other gateways. The configured limits should
638650
be divided by the number of active object gateways. For example, if "user A" is
639-
to be be limited to 10 ops per minute and there are two object gateways in the
640-
cluster, then the limit on "user A" should be ``5`` (10 ops per minute / 2
651+
to be be limited to 10 ops per accumulation interval and there are two object gateways in the
652+
cluster, then the limit on "user A" should be ``5`` (10 ops per accumulation interval / 2
641653
RGWs). If the requests are **not** balanced between RGWs, the rate limit might
642654
be underutilized. For example: if the ops limit is ``5`` and there are two
643655
RGWs, **but** the Load Balancer sends load to only one of those RGWs, the
@@ -654,10 +666,10 @@ rate limit is reached during the execution of the request. The RGW keeps track
654666
of a "debt" consisting of bytes used in excess of the configured value; users
655667
or buckets that incur this kind of debt are prevented from sending more
656668
requests until the "debt" has been repaid. The maximum size of the "debt" is
657-
twice the max-read/write-bytes per minute. If "user A" is subject to a 1-byte
658-
read limit per minute and they attempt to ``GET`` an object that is 1 GB in size,
669+
twice the max-read/write-bytes per accumulation interval. If "user A" is subject to a 1-byte
670+
read limit per accumulation interval and they attempt to ``GET`` an object that is 1 GB in size,
659671
then the ``GET`` action will fail. After "user A" has completed this 1 GB
660-
operation, RGW blocks the user's requests for up to two minutes. After this
672+
operation, RGW blocks the user's requests for up to two accumulation intervals. After this
661673
time has elapsed, "user A" will be able to send ``GET`` requests again.
662674

663675

@@ -668,19 +680,27 @@ time has elapsed, "user A" will be able to send ``GET`` requests again.
668680
user.
669681

670682
- **Maximum Read Ops:** The ``--max-read-ops`` setting allows you to limit read
671-
bytes per minute per RGW instance. A ``0`` value disables throttling.
683+
bytes per accumulation interval per RGW instance. A ``0`` value disables throttling.
672684

673685
- **Maximum Read Bytes:** The ``--max-read-bytes`` setting allows you to limit
674-
read bytes per minute per RGW instance. A ``0`` value disables throttling.
686+
read bytes per accumulation interval per RGW instance. A ``0`` value disables throttling.
675687

676688
- **Maximum Write Ops:** The ``--max-write-ops`` setting allows you to specify
677-
the maximum number of write ops per minute per RGW instance. A ``0`` value
689+
the maximum number of write ops per accumulation interval per RGW instance. A ``0`` value
678690
disables throttling.
679691

680692
- **Maximum Write Bytes:** The ``--max-write-bytes`` setting allows you to
681-
specify the maximum number of write bytes per minute per RGW instance. A
693+
specify the maximum number of write bytes per accumulation interval per RGW instance. A
682694
``0`` value disables throttling.
683-
695+
696+
- **Maximum List Ops:** The ``--max-list-ops`` setting allows you to
697+
specify the maximum number of bucket listing requests per accumulation interval per RGW instance.
698+
A ``0`` value disables throttling.
699+
700+
- **Maximum Delete Ops:** The ``--max-delete-ops`` setting allows you to
701+
specify the maximum number of delete operations per accumulation interval per RGW instance.
702+
A ``0`` value disables throttling.
703+
684704
- **Rate Limit Scope:** The ``--ratelimit-scope`` option sets the scope for the
685705
rate limit. The options are ``bucket`` , ``user`` and ``anonymous``. Bucket
686706
rate limit apply to buckets. The user rate limit applies to a user. The
@@ -699,7 +719,8 @@ parameters:
699719

700720
radosgw-admin ratelimit set --ratelimit-scope=user --uid=<uid> \
701721
<[--max-read-ops=<num ops>] [--max-read-bytes=<num bytes>] \
702-
[--max-write-ops=<num ops>] [--max-write-bytes=<num bytes>]>
722+
[--max-write-ops=<num ops>] [--max-write-bytes=<num bytes>] \
723+
[--max-list-ops=<num ops>] [--max-delete-ops=<num ops>]>
703724

704725
An example of using ``radosgw-admin ratelimit set`` to set a rate limit might
705726
look like this:
@@ -764,7 +785,8 @@ The following is the general form of commands that set rate limit parameters:
764785

765786
radosgw-admin ratelimit set --ratelimit-scope=bucket --bucket=<bucket> \
766787
<[--max-read-ops=<num ops>] [--max-read-bytes=<num bytes>] \
767-
[--max-write-ops=<num ops>] [--max-write-bytes=<num bytes>]>
788+
[--max-write-ops=<num ops>] [--max-write-bytes=<num bytes>] \
789+
[--max-list-ops=<num ops>] [--max-delete-ops=<num ops>]>
768790

769791
An example of using ``radosgw-admin ratelimit set`` to set a rate limit for a
770792
bucket might look like this:

doc/radosgw/adminops.rst

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,8 +2072,9 @@ as mentioned in Set Bucket Quota section above.
20722072
Rate Limit
20732073
==========
20742074

2075-
The Admin Operations API enables you to set and get ratelimit configurations on users and on bucket and global rate limit configurations. See `Rate Limit Management`_ for additional details.
2076-
Rate Limit includes the maximum number of operations and/or bytes per minute, separated by read and/or write, to a bucket and/or by a user and the maximum storage size in megabytes.
2075+
The Admin Operations API enables you to set and get ratelimit configurations on users and on bucket and global rate limit configurations. See `Rate Limit Management`_ for additional details.
2076+
Rate Limit includes the maximum number of operations and/or bytes per accumulation interval, separated by read and/or write (Additionally list and get operations),
2077+
to a bucket and/or by a user and the maximum storage size in megabytes.
20772078

20782079
To view rate limit, the user must have a ``ratelimit=read`` capability. To set,
20792080
modify or disable a ratelimit, the user must have ``ratelimit=write`` capability.
@@ -2087,16 +2088,22 @@ Valid parameters for quotas include:
20872088
- **User:** The ``uid`` option allows you to specify a rate limit for a user.
20882089

20892090
- **Maximum Read Bytes:** The ``max-read-bytes`` setting allows you to specify
2090-
the maximum number of read bytes per minute. A 0 value disables this setting.
2091+
the maximum number of read bytes per accumulation interval. A 0 value disables this setting.
20912092

20922093
- **Maximum Write Bytes:** The ``max-write-bytes`` setting allows you to specify
2093-
the maximum number of write bytes per minute. A 0 value disables this setting.
2094+
the maximum number of write bytes per accumulation interval. A 0 value disables this setting.
20942095

20952096
- **Maximum Read Ops:** The ``max-read-ops`` setting allows you to specify
2096-
the maximum number of read ops per minute. A 0 value disables this setting.
2097+
the maximum number of read ops per accumulation interval. A 0 value disables this setting.
20972098

20982099
- **Maximum Write Ops:** The ``max-write-ops`` setting allows you to specify
2099-
the maximum number of write ops per minute. A 0 value disables this setting.
2100+
the maximum number of write ops per accumulation interval. A 0 value disables this setting.
2101+
2102+
- **Maximum List Ops:** The ``max-list-ops`` setting allows you to specify
2103+
the maximum number of bucket listing requests per accumulation interval. A 0 value disables this setting.
2104+
2105+
- **Maximum Delete Ops:** The ``max-delete-ops`` setting allows you to specify
2106+
the maximum number of delete operations per accumulation interval. A 0 value disables throttling.
21002107

21012108
- **Global:** The ``global`` option allows you to specify a global rate limit.
21022109
The value should be either 'True' or 'False'.
@@ -2123,7 +2130,7 @@ Set User Rate Limit
21232130
To set a rate limit, the user must have ``ratelimit`` capability set with ``write``
21242131
permission. ::
21252132

2126-
POST /{admin}/ratelimit?ratelimit-scope=user&uid=<uid><[&max-read-bytes=<bytes>][&max-write-bytes=<bytes>][&max-read-ops=<ops>][&max-write-ops=<ops>][enabled=<True|False>]>
2133+
POST /{admin}/ratelimit?ratelimit-scope=user&uid=<uid><[&max-read-bytes=<bytes>][&max-write-bytes=<bytes>][&max-read-ops=<ops>][&max-write-ops=<ops>][&max-list-ops=<ops>][&max-delete-ops=<ops>][&enabled=<True|False>]>
21272134

21282135

21292136

@@ -2143,7 +2150,7 @@ Set Rate Limit for an Individual Bucket
21432150
To set a rate limit, the user must have ``ratelimit`` capability set with ``write``
21442151
permission. ::
21452152

2146-
POST /{admin}/ratelimit?bucket=<bucket-name>&ratelimit-scope=bucket<[&max-read-bytes=<bytes>][&max-write-bytes=<bytes>][&max-read-ops=<ops>][&max-write-ops=<ops>]>
2153+
POST /{admin}/ratelimit?bucket=<bucket-name>&ratelimit-scope=bucket<[&max-read-bytes=<bytes>][&max-write-bytes=<bytes>][&max-read-ops=<ops>][&max-write-ops=<ops>][&max-list-ops=<ops>][&max-delete-ops=<ops>][&enabled=<True|False>]>
21472154

21482155

21492156

@@ -2163,7 +2170,7 @@ Set Global User Rate Limit
21632170
To set a rate limit, the user must have ``ratelimit`` capability set with ``write``
21642171
permission. ::
21652172

2166-
POST /{admin}/ratelimit?ratelimit-scope=user&global=<True|False><[&max-read-bytes=<bytes>][&max-write-bytes=<bytes>][&max-read-ops=<ops>][&max-write-ops=<ops>][enabled=<True|False>]>
2173+
POST /{admin}/ratelimit?ratelimit-scope=user&global=<True|False><[&max-read-bytes=<bytes>][&max-write-bytes=<bytes>][&max-read-ops=<ops>][&max-write-ops=<ops>][&max-list-ops=<ops>][&max-delete-ops=<ops>][&enabled=<True|False>]>
21672174

21682175

21692176

@@ -2173,7 +2180,7 @@ Set Global Rate Limit Bucket
21732180
To set a rate limit, the user must have ``ratelimit`` capability set with ``write``
21742181
permission. ::
21752182

2176-
POST /{admin}/ratelimit?ratelimit-scope=bucket&global=<True|False><[&max-read-bytes=<bytes>][&max-write-bytes=<bytes>][&max-read-ops=<ops>][&max-write-ops=<ops>]>
2183+
POST /{admin}/ratelimit?ratelimit-scope=bucket&global=<True|False><[&max-read-bytes=<bytes>][&max-write-bytes=<bytes>][&max-read-ops=<ops>][&max-write-ops=<ops>][&max-list-ops=<ops>][&max-delete-ops=<ops>][&enabled=<True|False>]>
21772184

21782185

21792186

@@ -2183,7 +2190,7 @@ Set Global Anonymous User Rate Limit
21832190
To set a rate limit, the user must have ``ratelimit`` capability set with ``write``
21842191
permission. ::
21852192

2186-
POST /{admin}/ratelimit?ratelimit-scope=anon&global=<True|False><[&max-read-bytes=<bytes>][&max-write-bytes=<bytes>][&max-read-ops=<ops>][&max-write-ops=<ops>][enabled=<True|False>]>
2193+
POST /{admin}/ratelimit?ratelimit-scope=anon&global=<True|False><[&max-read-bytes=<bytes>][&max-write-bytes=<bytes>][&max-read-ops=<ops>][&max-write-ops=<ops>][&max-list-ops=<ops>][&max-delete-ops=<ops>][&enabled=<True|False>]>
21872194

21882195

21892196

qa/tasks/radosgw_admin_rest.py

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,3 +982,74 @@ def task(ctx, config):
982982
# TESTCASE 'ratelimit' 'global' 'modify' 'anonymous' 'enabled' 'succeeds'
983983
(ret, out) = rgwadmin_rest(admin_conn, ['ratelimit', 'modify'], {'ratelimit-scope' : 'bucket', 'global': 'true', 'enabled' : 'true'})
984984
assert ret == 200
985+
986+
# TESTCASE 'ratelimit' 'user' 'modify' 'max-list-ops = 100' 'succeeds'
987+
(ret, out) = rgwadmin_rest(admin_conn, ['ratelimit', 'modify'], {'ratelimit-scope' : 'user', 'uid' : ratelimit_user, 'max-list-ops' : '100'})
988+
assert ret == 200
989+
(ret, out) = rgwadmin_rest(admin_conn, ['ratelimit', 'info'], {'ratelimit-scope' : 'user', 'uid' : ratelimit_user})
990+
assert ret == 200
991+
user_ratelimit = out['user_ratelimit']
992+
assert user_ratelimit['max_list_ops'] == 100
993+
994+
# TESTCASE 'ratelimit' 'user' 'modify' 'max-delete-ops = 50' 'succeeds'
995+
(ret, out) = rgwadmin_rest(admin_conn, ['ratelimit', 'modify'], {'ratelimit-scope' : 'user', 'uid' : ratelimit_user, 'max-delete-ops' : '50'})
996+
assert ret == 200
997+
(ret, out) = rgwadmin_rest(admin_conn, ['ratelimit', 'info'], {'ratelimit-scope' : 'user', 'uid' : ratelimit_user})
998+
assert ret == 200
999+
user_ratelimit = out['user_ratelimit']
1000+
assert user_ratelimit['max_delete_ops'] == 50
1001+
1002+
# TESTCASE 'ratelimit' 'bucket' 'modify' 'max-list-ops = 200' 'succeeds'
1003+
(ret, out) = rgwadmin_rest(admin_conn, ['ratelimit', 'modify'], {'ratelimit-scope' : 'bucket', 'bucket' : ratelimit_bucket, 'max-list-ops' : '200'})
1004+
assert ret == 200
1005+
(ret, out) = rgwadmin_rest(admin_conn, ['ratelimit', 'info'], {'ratelimit-scope' : 'bucket', 'bucket' : ratelimit_bucket})
1006+
assert ret == 200
1007+
bucket_ratelimit = out['bucket_ratelimit']
1008+
assert bucket_ratelimit['max_list_ops'] == 200
1009+
1010+
# TESTCASE 'ratelimit' 'bucket' 'modify' 'max-delete-ops = 75' 'succeeds'
1011+
(ret, out) = rgwadmin_rest(admin_conn, ['ratelimit', 'modify'], {'ratelimit-scope' : 'bucket', 'bucket' : ratelimit_bucket, 'max-delete-ops' : '75'})
1012+
assert ret == 200
1013+
(ret, out) = rgwadmin_rest(admin_conn, ['ratelimit', 'info'], {'ratelimit-scope' : 'bucket', 'bucket' : ratelimit_bucket})
1014+
assert ret == 200
1015+
bucket_ratelimit = out['bucket_ratelimit']
1016+
assert bucket_ratelimit['max_delete_ops'] == 75
1017+
1018+
# TESTCASE 'ratelimit' 'global' 'modify' 'bucket' 'max-list-ops = 500' 'succeeds'
1019+
(ret, out) = rgwadmin_rest(admin_conn, ['ratelimit', 'modify'], {'ratelimit-scope' : 'bucket', 'global': 'true', 'max-list-ops' : '500'})
1020+
assert ret == 200
1021+
(ret, out) = rgwadmin_rest(admin_conn, ['ratelimit', 'info'], {'global' : 'true'})
1022+
assert ret == 200
1023+
# Check that global bucket ratelimit has the list ops set
1024+
assert 'bucket_ratelimit' in out
1025+
assert out['bucket_ratelimit']['max_list_ops'] == 500
1026+
1027+
# TESTCASE 'ratelimit' 'global' 'modify' 'bucket' 'max-delete-ops = 300' 'succeeds'
1028+
(ret, out) = rgwadmin_rest(admin_conn, ['ratelimit', 'modify'], {'ratelimit-scope' : 'bucket', 'global': 'true', 'max-delete-ops' : '300'})
1029+
assert ret == 200
1030+
(ret, out) = rgwadmin_rest(admin_conn, ['ratelimit', 'info'], {'global' : 'true'})
1031+
assert ret == 200
1032+
# Check that global bucket ratelimit has the delete ops set
1033+
assert 'bucket_ratelimit' in out
1034+
assert out['bucket_ratelimit']['max_delete_ops'] == 300
1035+
1036+
# TESTCASE 'ratelimit' 'user' 'modify' 'multiple ops at once' 'succeeds'
1037+
(ret, out) = rgwadmin_rest(admin_conn, ['ratelimit', 'modify'], {
1038+
'ratelimit-scope' : 'user',
1039+
'uid' : ratelimit_user,
1040+
'max-read-ops' : '1000',
1041+
'max-write-ops' : '800',
1042+
'max-list-ops' : '600',
1043+
'max-delete-ops' : '400',
1044+
'enabled' : 'true'
1045+
})
1046+
assert ret == 200
1047+
(ret, out) = rgwadmin_rest(admin_conn, ['ratelimit', 'info'], {'ratelimit-scope' : 'user', 'uid' : ratelimit_user})
1048+
assert ret == 200
1049+
user_ratelimit = out['user_ratelimit']
1050+
assert user_ratelimit['enabled'] == True
1051+
assert user_ratelimit['max_read_ops'] == 1000
1052+
assert user_ratelimit['max_write_ops'] == 800
1053+
assert user_ratelimit['max_list_ops'] == 600
1054+
assert user_ratelimit['max_delete_ops'] == 400
1055+

src/common/options/rgw.yaml.in

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4498,6 +4498,20 @@ options:
44984498
default: false
44994499
services:
45004500
- rgw
4501+
- name: rgw_ratelimit_interval
4502+
type: uint
4503+
level: advanced
4504+
desc: Time window for rate limiting in seconds
4505+
long_desc: This option sets the time window for rate limiting accumulation in seconds.
4506+
Requests that exceed the configured rate limits within this time window will be rejected.
4507+
The default is a 60 second token bucket.
4508+
default: 60
4509+
min: 1
4510+
services:
4511+
- rgw
4512+
flags:
4513+
- startup
4514+
with_legacy: true
45014515
- name: rgw_redis_connection_pool_size
45024516
type: int
45034517
level: basic

0 commit comments

Comments
 (0)