1. Initial situation [root@ceph ~]# radosgw-admin user info --uid admin { "user_id": "admin", "display_name": "admin", ......... "caps": [ { "type": "buckets", "perm": "read" }, { "type": "metadata", "perm": "read" }, { "type": "usage", "perm": "read" }, { "type": "users", "perm": "read" }, { "type": "zone", "perm": "read" } ], ......... "bucket_quota": { "enabled": false, "check_on_raw": false, "max_size": -1, "max_size_kb": 0, "max_objects": -1 }, "user_quota": { "enabled": false, "check_on_raw": false, "max_size": -1, "max_size_kb": 0, "max_objects": -1 }, ......... } [root@ceph ~]# radosgw-admin user stats --uid=admin --sync-stats { "stats": { "total_entries": 0, "total_bytes": 0, "total_bytes_rounded": 0 }, "last_stats_sync": "2021-07-12 01:00:11.899886Z", "last_stats_update": "2021-07-12 00:58:24.423704Z" } 2. Without quota: [root@haihang test]# s3cmd ls [root@haihang test]# s3cmd la [root@haihang test]# s3cmd mb s3://dlweb-haha Bucket 's3://dlweb-haha/' created [root@haihang test]# ls -lh ...... -rw-r--r-- 1 root root 200M Jun 29 14:18 file -rw-r--r-- 1 root root 200M Jul 12 08:59 file1 -rw------- 1 root root 246M Jun 29 10:36 python1.tar -rw------- 1 root root 246M Jun 29 10:28 python.tar [root@haihang test]# s3cmd put file s3://dlweb-haha upload: 'file' -> 's3://dlweb-haha/file' [part 1 of 14, 15MB] [1 of 1] 15728640 of 15728640 100% in 0s 42.34 MB/s done ......... upload: 'file' -> 's3://dlweb-haha/file' [part 14 of 14, 5MB] [1 of 1] 5242880 of 5242880 100% in 0s 30.03 MB/s done [root@haihang test]# s3cmd put file1 s3://dlweb-haha upload: 'file1' -> 's3://dlweb-haha/file1' [part 1 of 14, 15MB] [1 of 1] 15728640 of 15728640 100% in 0s 38.09 MB/s done ......... upload: 'file1' -> 's3://dlweb-haha/file1' [part 14 of 14, 5MB] [1 of 1] 5242880 of 5242880 100% in 0s 35.89 MB/s done [root@ceph ~]# radosgw-admin user stats --uid=admin --sync-stats { "stats": { "total_entries": 2, "total_bytes": 419430400, "total_bytes_rounded": 419430400 }, "last_stats_sync": "2021-07-12 01:06:42.922618Z", "last_stats_update": "2021-07-12 01:06:42.917389Z" } As expected. 3. Set quota to 300M. [root@haihang test]# s3cmd del s3://dlweb-haha/file1 delete: 's3://dlweb-haha/file1' [root@haihang test]# s3cmd del s3://dlweb-haha/file delete: 's3://dlweb-haha/file' [root@ceph ~]# radosgw-admin quota set --quota-scope=user --uid admin --max-size 300M [root@ceph ~]# radosgw-admin quota enable --quota-scope=user --uid admin [root@ceph ~]# radosgw-admin user info --uid admin { ......... "bucket_quota": { "enabled": false, "check_on_raw": false, "max_size": -1, "max_size_kb": 0, "max_objects": -1 }, "user_quota": { "enabled": true, "check_on_raw": false, "max_size": 314572800, "max_size_kb": 307200, "max_objects": -1 }, ......... } [root@haihang test]# [root@haihang test]# s3cmd del s3://dlweb-haha/file1 delete: 's3://dlweb-haha/file1' [root@haihang test]# s3cmd del s3://dlweb-haha/file delete: 's3://dlweb-haha/file' [root@haihang test]# s3cmd ls -rH s3://dlweb-haha [root@haihang test]# s3cmd put file s3://dlweb-haha upload: 'file' -> 's3://dlweb-haha/file' [part 1 of 14, 15MB] [1 of 1] 15728640 of 15728640 100% in 0s 40.24 MB/s done ......... upload: 'file' -> 's3://dlweb-haha/file' [part 14 of 14, 5MB] [1 of 1] 5242880 of 5242880 100% in 0s 29.63 MB/s done [root@haihang test]# s3cmd put file1 s3://dlweb-haha upload: 'file1' -> 's3://dlweb-haha/file1' [part 1 of 14, 15MB] [1 of 1] 15728640 of 15728640 100% in 0s 38.65 MB/s done ......... upload: 'file1' -> 's3://dlweb-haha/file1' [part 7 of 14, 15MB] [1 of 1] 15728640 of 15728640 100% in 0s 85.72 MB/s done ERROR: Upload of 'file1' part 7 failed. Use /usr/local/bin/s3cmd abortmp s3://dlweb-haha/file1 2~C4d44FmnTq8OBu0sSPKvk1HTUDQy9OO to abort the upload, or /usr/local/bin/s3cmd --upload-id 2~C4d44FmnTq8OBu0sSPKvk1HTUDQy9OO put ... to continue the upload. ERROR: S3 error: 403 (QuotaExceeded) As Expected. 4. Then set max-size quota from 300M to 500M. [root@ceph ~]# radosgw-admin quota set --quota-scope=user --uid admin --max-size 500M [root@haihang test]# s3cmd put file1 s3://dlweb-haha upload: 'file1' -> 's3://dlweb-haha/file1' [part 1 of 14, 15MB] [1 of 1] 15728640 of 15728640 100% in 0s 38.09 MB/s done ......... upload: 'file1' -> 's3://dlweb-haha/file1' [part 14 of 14, 5MB] [1 of 1] 5242880 of 5242880 100% in 0s 35.89 MB/s done [root@haihang test]# s3cmd ls -rH s3://dlweb-haha 2021-07-12 01:16 200M s3://dlweb-haha/file 2021-07-12 01:20 200M s3://dlweb-haha/file1 Now bucket dlweb-haha has stored 400M, then try to upload python.tar(246M) [root@haihang test]# s3cmd put python.tar s3://dlweb-haha upload: 'python.tar' -> 's3://dlweb-haha/python.tar' [part 1 of 3, 100MB] [1 of 1] 104857600 of 104857600 100% in 1s 93.70 MB/s done ERROR: Upload of 'python.tar' part 1 failed. Use /usr/local/bin/s3cmd abortmp s3://dlweb-haha/python.tar 2~kcE4EZZEJ03i9br9OSvaFOW5ezks66Z to abort the upload, or /usr/local/bin/s3cmd --upload-id 2~kcE4EZZEJ03i9br9OSvaFOW5ezks66Z put ... to continue the upload. ERROR: S3 error: 403 (QuotaExceeded) As expected, Then delete file1(200M). [root@haihang test]# s3cmd ls -rH s3://dlweb-haha 2021-07-12 01:16 200M s3://dlweb-haha/file 2021-07-12 01:20 200M s3://dlweb-haha/file1 [root@haihang test]# s3cmd del s3://dlweb-haha/file1 delete: 's3://dlweb-haha/file1' Current bucket dlweb-haha has stored just 200M, while quota is 500M. Then try to upload python.tar(246M), we get unexpected. [root@haihang test]# s3cmd put python.tar s3://dlweb-haha upload: 'python.tar' -> 's3://dlweb-haha/python.tar' [part 1 of 3, 100MB] [1 of 1] 104857600 of 104857600 100% in 2s 49.85 MB/s done upload: 'python.tar' -> 's3://dlweb-haha/python.tar' [part 2 of 3, 100MB] [1 of 1] 104857600 of 104857600 100% in 1s 51.31 MB/s done upload: 'python.tar' -> 's3://dlweb-haha/python.tar' [part 3 of 3, 45MB] [1 of 1] 47887872 of 47887872 100% in 0s 95.27 MB/s done ERROR: Upload of 'python.tar' part 3 failed. Use /usr/local/bin/s3cmd abortmp s3://dlweb-haha/python.tar 2~ZKwTBczSQHkrApl43SVWRalchaxOx-H to abort the upload, or /usr/local/bin/s3cmd --upload-id 2~ZKwTBczSQHkrApl43SVWRalchaxOx-H put ... to continue the upload. ERROR: S3 error: 403 (QuotaExceeded) [root@haihang test]# s3cmd ls -rH s3://dlweb-haha 2021-07-12 01:16 200M s3://dlweb-haha/file