Skip to content

Commit e33ea91

Browse files
authored
Merge pull request ceph#55075 from zdover23/wip-doc-2024-01-07-radosgw-admin-quota
doc/radosgw: edit admin.rst - quota Reviewed-by: Anthony D'Atri <[email protected]>
2 parents 60c4b64 + 22fce3c commit e33ea91

File tree

1 file changed

+104
-65
lines changed

1 file changed

+104
-65
lines changed

doc/radosgw/admin.rst

Lines changed: 104 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,9 @@ following form:
395395
Quota Management
396396
================
397397

398-
The Ceph Object Gateway enables you to set quotas on users and buckets owned by
399-
users. Quotas include the maximum number of objects in a bucket and the maximum
400-
storage size a bucket can hold.
398+
The Ceph Object Gateway makes it possible for you to set quotas on users and
399+
buckets owned by users. Quotas include the maximum number of objects in a
400+
bucket and the maximum storage size a bucket can hold.
401401

402402
- **Bucket:** The ``--bucket`` option allows you to specify a quota for
403403
buckets the user owns.
@@ -406,149 +406,188 @@ storage size a bucket can hold.
406406
the maximum number of objects. A negative value disables this setting.
407407

408408
- **Maximum Size:** The ``--max-size`` option allows you to specify a quota
409-
size in B/K/M/G/T, where B is the default. A negative value disables this setting.
409+
size in B/K/M/G/T, where B is the default. A negative value disables this
410+
setting.
410411

411412
- **Quota Scope:** The ``--quota-scope`` option sets the scope for the quota.
412-
The options are ``bucket`` and ``user``. Bucket quotas apply to buckets a
413-
user owns. User quotas apply to a user.
413+
The options are ``bucket`` and ``user``. Bucket quotas apply to each bucket
414+
owned by the user. User Quotas are summed across all buckets owned by the
415+
user.
414416

415417

416418
Set User Quota
417419
--------------
418420

419421
Before you enable a quota, you must first set the quota parameters.
420-
For example::
422+
To set quota parameters, run a command of the following form:
421423

422-
radosgw-admin quota set --quota-scope=user --uid=<uid> [--max-objects=<num objects>] [--max-size=<max size>]
424+
.. prompt:: bash
423425

424-
For example::
426+
radosgw-admin quota set --quota-scope=user --uid=<uid> [--max-objects=<num objects>] [--max-size=<max size>]
425427

426-
radosgw-admin quota set --quota-scope=user --uid=johndoe --max-objects=1024 --max-size=1024B
428+
For example:
427429

430+
.. prompt:: bash
428431

429-
A negative value for num objects and / or max size means that the
430-
specific quota attribute check is disabled.
432+
radosgw-admin quota set --quota-scope=user --uid=johndoe --max-objects=1024 --max-size=1024B
431433

434+
Passing a negative value as an argument of ``--max-objects`` or ``--max-size``
435+
disables the given quota attribute.
432436

433-
Enable/Disable User Quota
434-
-------------------------
435437

436-
Once you set a user quota, you may enable it. For example::
438+
Enabling and Disabling User Quota
439+
---------------------------------
437440

438-
radosgw-admin quota enable --quota-scope=user --uid=<uid>
441+
After a user quota is set, it must be enabled in order to take effect. To enable a user quota, run a command of the following form:
439442

440-
You may disable an enabled user quota. For example::
443+
.. prompt:: bash
444+
445+
radosgw-admin quota enable --quota-scope=user --uid=<uid>
441446

442-
radosgw-admin quota disable --quota-scope=user --uid=<uid>
447+
To disable an enabled user quota, run a command of the following form:
448+
449+
.. prompt:: bash
450+
451+
radosgw-admin quota disable --quota-scope=user --uid=<uid>
443452

444453

445454
Set Bucket Quota
446455
----------------
447456

448457
Bucket quotas apply to the buckets owned by the specified ``uid``. They are
449-
independent of the user. ::
458+
independent of the user. To set a bucket quota, run a command of the following
459+
form:
460+
461+
.. prompt:: bash
450462

451-
radosgw-admin quota set --uid=<uid> --quota-scope=bucket [--max-objects=<num objects>] [--max-size=<max size]
463+
radosgw-admin quota set --uid=<uid> --quota-scope=bucket [--max-objects=<num objects>] [--max-size=<max size]
452464

453-
A negative value for num objects and / or max size means that the
454-
specific quota attribute check is disabled.
465+
A negative value for ``--max-objects`` or ``--max-size`` means that the
466+
specific quota attribute is disabled.
455467

456468

457-
Enable/Disable Bucket Quota
458-
---------------------------
469+
Enable and Disabling Bucket Quota
470+
---------------------------------
459471

460-
Once you set a bucket quota, you may enable it. For example::
472+
After a bucket quota has been set, it must be enabled in order to take effect.
473+
To enable a bucket quota, run a command of the following form:
461474

462-
radosgw-admin quota enable --quota-scope=bucket --uid=<uid>
475+
.. prompt:: bash
476+
477+
radosgw-admin quota enable --quota-scope=bucket --uid=<uid>
463478

464-
You may disable an enabled bucket quota. For example::
479+
To disable an enabled bucket quota, run a command of the following form:
480+
481+
.. prompt:: bash
465482

466-
radosgw-admin quota disable --quota-scope=bucket --uid=<uid>
483+
radosgw-admin quota disable --quota-scope=bucket --uid=<uid>
467484

468485

469486
Get Quota Settings
470487
------------------
471488

472-
You may access each user's quota settings via the user information
489+
You can access each user's quota settings via the user information
473490
API. To read user quota setting information with the CLI interface,
474-
execute the following::
491+
run a command of the following form:
475492

476-
radosgw-admin user info --uid=<uid>
493+
.. prompt:: bash
494+
495+
radosgw-admin user info --uid=<uid>
477496

478497

479498
Update Quota Stats
480499
------------------
481500

482-
Quota stats get updated asynchronously. You can update quota
483-
statistics for all users and all buckets manually to retrieve
484-
the latest quota stats. ::
501+
Quota stats are updated asynchronously. You can update quota statistics for all
502+
users and all buckets manually to force an update of the latest quota stats. To
503+
update quota statistics for all users and all buckets in order to retrieve the
504+
latest quota statistics, run a command of the following form:
485505

486-
radosgw-admin user stats --uid=<uid> --sync-stats
506+
.. prompt:: bash
507+
508+
radosgw-admin user stats --uid=<uid> --sync-stats
487509

488510
.. _rgw_user_usage_stats:
489511

490512
Get User Usage Stats
491513
--------------------
492514

493-
To see how much of the quota a user has consumed, execute the following::
515+
To see how much of a quota a user has consumed, run a command of the following
516+
form:
494517

495-
radosgw-admin user stats --uid=<uid>
518+
.. prompt:: bash
519+
520+
radosgw-admin user stats --uid=<uid>
496521

497-
.. note:: You should execute ``radosgw-admin user stats`` with the
498-
``--sync-stats`` option to receive the latest data.
522+
.. note:: Run ``radosgw-admin user stats`` with the ``--sync-stats`` option to
523+
receive the latest data.
499524

500525
Default Quotas
501526
--------------
502527

503-
You can set default quotas in the config. These defaults are used when
504-
creating a new user and have no effect on existing users. If the
505-
relevant default quota is set in config, then that quota is set on the
506-
new user, and that quota is enabled. See ``rgw_bucket_default_quota_max_objects``,
507-
``rgw_bucket_default_quota_max_size``, ``rgw_user_default_quota_max_objects``, and
508-
``rgw_user_default_quota_max_size`` in `Ceph Object Gateway Config Reference`_
528+
You can set default quotas in the Ceph Object Gateway config. **These defaults
529+
will be used only when creating new users and will have no effect on existing
530+
users.** If a default quota is set in the Ceph Object Gateway Config, then that
531+
quota is set for all subsequently-created users, and that quota is enabled. See
532+
``rgw_bucket_default_quota_max_objects``,
533+
``rgw_bucket_default_quota_max_size``, ``rgw_user_default_quota_max_objects``,
534+
and ``rgw_user_default_quota_max_size`` in `Ceph Object Gateway Config
535+
Reference`_
509536

510537
Quota Cache
511538
-----------
512539

513-
Quota statistics are cached on each RGW instance. If there are multiple
514-
instances, then the cache can keep quotas from being perfectly enforced, as
515-
each instance will have a different view of quotas. The options that control
516-
this are ``rgw_bucket_quota_ttl``, ``rgw_user_quota_bucket_sync_interval`` and
517-
``rgw_user_quota_sync_interval``. The higher these values are, the more
518-
efficient quota operations are, but the more out-of-sync multiple instances
519-
will be. The lower these values are, the closer to perfect enforcement
520-
multiple instances will achieve. If all three are 0, then quota caching is
521-
effectively disabled, and multiple instances will have perfect quota
522-
enforcement. See `Ceph Object Gateway Config Reference`_
540+
Quota statistics are cached by each RGW instance. If multiple RGW instances are
541+
deployed, then this cache may prevent quotas from being perfectly enforced,
542+
because each instance may have a different set of quota settings.
543+
544+
The options that control this behavior are
545+
546+
#. ``rgw_bucket_quota_ttl``
547+
#. ``rgw_user_quota_bucket_sync_interval`` and
548+
#. ``rgw_user_quota_sync_interval``.
549+
550+
Increasing these values will make quota operations more efficient at the cost
551+
of increasing the likelihood that the multiple RGW instances may not
552+
consistently have the latest quota settings. Decreasing these values brings
553+
the multiple RGW instances closer to perfect quota synchronization.
554+
555+
If all three values are set to ``0`` , then quota caching is effectively
556+
disabled, and multiple instances will have perfect quota enforcement. See
557+
`Ceph Object Gateway Config Reference`_.
523558

524559
Reading / Writing Global Quotas
525560
-------------------------------
526561

527562
You can read and write global quota settings in the period configuration. To
528-
view the global quota settings::
563+
view the global quota settings, run the following command:
564+
565+
.. prompt:: bash
529566

530-
radosgw-admin global quota get
567+
radosgw-admin global quota get
531568

532-
The global quota settings can be manipulated with the ``global quota``
569+
Global quota settings can be manipulated with the ``global quota``
533570
counterparts of the ``quota set``, ``quota enable``, and ``quota disable``
534-
commands. ::
571+
commands, as in the following examples:
572+
573+
.. prompt:: bash
535574

536575
radosgw-admin global quota set --quota-scope bucket --max-objects 1024
537576
radosgw-admin global quota enable --quota-scope bucket
538577

539-
.. note:: In a multisite configuration, where there is a realm and period
578+
.. note:: In a multisite configuration where there is a realm and period
540579
present, changes to the global quotas must be committed using ``period
541-
update --commit``. If there is no period present, the rados gateway(s) must
580+
update --commit``. If no period is present, the RGW instances must
542581
be restarted for the changes to take effect.
543582

544583

545584
Rate Limit Management
546585
=====================
547586

548-
The Ceph Object Gateway makes it possible to set rate limits on users and
549-
buckets. "Rate limit" includes the maximum number of read operations (read
550-
ops) and write operations (write ops) per minute and the number of bytes per
551-
minute that can be written or read per user or per bucket.
587+
Quotas may be set for The Ceph Object Gateway on users and buckets. "Rate
588+
limit" includes the maximum number of read operations (read ops) and write
589+
operations (write ops) per minute and the number of bytes per minute that can
590+
be written or read per user or per bucket.
552591

553592
Operations that use the ``GET`` method or the ``HEAD`` method in their REST
554593
requests are "read requests". All other requests are "write requests".

0 commit comments

Comments
 (0)