Basic container quotas

Add a new middleware implementing some basic container quotas.

Quotas are subject to several limitations: eventual consistency, the timeliness
of the cached container_info (60 second ttl by default), and it’s unable to
reject chunked transfer uploads that exceed the quota (though once the quota
is exceeded, new chunked transfers will be refused).

However, they get most of the way to container quotas fairly inexpensively.

Quotas are set by adding meta values to the container, and are validated when
set:

  X-Container-Meta-Quota-Bytes: Maximum size of the container, in bytes.
  X-Container-Meta-Quota-Count: Maximum object count of the container.

DocImpact

Change-Id: I77cfbf6dc231a2e522bd67328e4c082424a93eee
This commit is contained in:
Michael Barton
2013-01-31 21:53:47 -08:00
parent 65baec39d2
commit 24ef12027c
6 changed files with 317 additions and 4 deletions

View File

@@ -33,7 +33,7 @@
# eventlet_debug = false
[pipeline:main]
pipeline = catch_errors healthcheck cache ratelimit tempauth proxy-logging proxy-server
pipeline = catch_errors healthcheck cache ratelimit tempauth container-quotas proxy-logging proxy-server
[app:proxy-server]
use = egg:swift#proxy
@@ -338,3 +338,7 @@ use = egg:swift#bulk
# max_containers_per_extraction = 10000
# max_failed_files = 1000
# max_deletes_per_request = 1000
# Note: Put after auth in the pipeline.
[filter:container-quotas]
use = egg:swift#container_quotas