swift.conf(5)
π swift.conf(5) β the OpenStack Swift glow-up π
okay bestie, listen. this is swift.conf, the common configuration file for the OpenStack object storage services. she's the shared vibe file that literally every service in OpenStack object storage reads from. not a side character. the main character. periodt. π
β¨ SYNOPSIS β¨
swift.conf
π¦ DESCRIPTION π¦
so this is the common configuration file used by all services of OpenStack object storage services. everybody shares her, no cap.
the config file follows the python-pastedeploy syntax. she's split into sections, and sections are wrapped in square brackets [like this]. each section holds a certain number of key/value parameters, and we'll get into those below, don't worry.
any line that starts with a # symbol is ignored. so go off with your comments, they're literally invisible. π
you can find more info about the python-pastedeploy configuration format at https://docs.pylonsproject.org/projects/pastedeploy/en/latest/#config-format
πΈ SWIFT HASH SECTION πΈ
this one is indicated by the section named [swift-hash]. here's what you're allowed to put in her:
swift_hash_path_suffixswift_hash_path_prefix
okay so swift_hash_path_suffix and swift_hash_path_prefix are used as part of the hashing algorithm when figuring out data placement in the cluster. these values should remain secret and MUST NOT change once a cluster has been deployed. like, do not touch them. not even a little. π
use only printable chars, like:
python -c "import string; print(string.printable)"
π STORAGE POLICY SECTION π
this one is indicated by the section name [storage-policy:#].
storage policies get defined here, and they determine various characteristics about how objects are stored and treated. policies are specified by name on a per container basis. the policy index is specified in the section header and is used internally.
the policy with index 0 is always used for legacy containers and can be given a name for use in metadata β but the ring file name will always be object.ring.gz for backwards compatibility. if no policies are defined, a policy with index 0 will be automatically created for backwards compatibility and given the name Policy-0.
a default policy is used when creating new containers when no policy is specified in the request. if no other policies are defined, the policy with index 0 will be declared the default. if multiple policies are defined, you must define a policy with index 0 and you must specify a default. it is recommended you always define a section for storage-policy:0. aliases are not mandatory when defining a storage policy. π«Ά
[storage-policy:index]
each storage policy is defined in a separate section with an index specified in the header. below are the parameters that are acceptable within this section:
nameβ name of the storage policy. policy names are case insensitive.aliasesβ multiple names can be assigned to one policy using aliases. all names must follow the Swift naming rules.policy_typeβ policy type can bereplicationorerasure_coding. a replication policy replicates the objects to a specified number of replicas. erasure coding uses the PyECLib API library for encode/decode operations. please refer to Swift documentation for details on how erasure coding is implemented.ec_typeβ this parameter must be chosen from the list of EC backends supported by PyECLib.ec_num_data_fragmentsβ this parameter is specific toerasure codingpolicy_typeonly. it defines the number of fragments that will be comprised of data.ec_num_parity_fragmentsβ this parameter is specific toerasure codingpolicy_typeonly. it defines the number of fragments that will be comprised of parity.ec_object_segment_sizeβ this parameter is specific toerasure codingpolicy_typeonly. it defines the amount of data that will be buffered up before feeding a segment into the encoder/decoder. the default value is1048576.
β¨ Examples β¨
[storage-policy:0]
name = Policy-0
default = yes
policy_type = replication
aliases = yellow, orange
[storage-policy:1]
name = silver
policy_type = replication
[storage-policy:2]
name = deepfreeze10-4
aliases = df10-4
policy_type = erasure_coding
ec_type = liberasurecode_rs_vand
ec_num_data_fragments = 10
ec_num_parity_fragments = 4
ec_object_segment_size = 1048576
π§ SWIFT CONSTRAINTS SECTION π§
this one is indicated by the section name [swift-constraints]. this section sets the basic constraints on data saved in the swift cluster. these constraints are automatically published by the proxy server in responses to /info requests. here's what's acceptable in here:
max_file_sizeβmax_file_sizeis the largest "normal" object that can be saved in the cluster. this is also the limit on the size of each segment of a "large" object when using the large object manifest support. this value is set in bytes. setting it to lower than1MiBwill cause some tests to fail. it is STRONGLY recommended to leave this value at the default (5 * 2**30 + 2). bestie, don't touch it. π₯max_meta_name_lengthβmax_meta_name_lengthis the max number of bytes in the utf8 encoding of the name portion of a metadata header.max_meta_value_lengthβmax_meta_value_lengthis the max number of bytes in the utf8 encoding of a metadata value.max_meta_countβmax_meta_countis the max number of metadata keys that can be stored on a single account, container, or object.max_meta_overall_sizeβmax_meta_overall_sizeis the max number of bytes in the utf8 encoding of the metadata (keys + values).max_header_sizeβmax_header_sizeis the max number of bytes in the utf8 encoding of each header. using8192as default because eventlet uses8192as max size of header line. this value may need to be increased when using identity v3 API tokens including more than 7 catalog entries.extra_header_countβ by default the maximum number of allowed headers depends on the number of max allowed metadata settings plus a default value of36for swift internally generated headers and regular http headers. if for some reason this is not enough (custom middleware for example) it can be increased with theextra_header_countconstraint.max_object_name_lengthβmax_object_name_lengthis the max number of bytes in the utf8 encoding of an object name.container_listing_limitβcontainer_listing_limitis the default (and max) number of items returned for a container listing request.account_listing_limitβaccount_listing_limitis the default (and max) number of items returned for an account listing request.max_account_name_lengthβmax_account_name_lengthis the max number of bytes in the utf8 encoding of an account name.max_container_name_lengthβmax_container_name_lengthis the max number of bytes in the utf8 encoding of a container name.valid_api_versionsβ by default, all REST API calls should use"v1"or"v1.0"as the version string, for example/v1/account. this can be manually overridden to make this backward-compatible, in case a different version string has been used before. use a comma-separated list in case of multiple allowed versions, for examplevalid_api_versions = v0,v1,v2. this is only enforced for account, container and object requests. the allowed api versions are by default excluded from/info.auto_create_account_prefixβauto_create_account_prefixspecifies the prefix for system accounts, such as those used by theobject-expirer, andcontainer-sharder. default is".".
π DOCUMENTATION π
more in-depth documentation about the swift.conf and also OpenStack-Swift as a whole can be found at https://docs.openstack.org/swift/latest/admin_guide.html and https://docs.openstack.org/swift/latest/
and that's the whole page bestie π this one's from the Linux manual, dated 8/8/2016, and she's filed as swift.conf(5). iconic. ate. no crumbs. go configure something beautiful. β¨π¦π
π¦ where this page comes from
- debian trixie: swift 2.35.1-0+deb13u3 Β· Apache-2
- debian trixie: swift 2.35.1-0+deb13u4 Β· Apache-2
- nixos 26.05: python3.13-swift 2.37.1
- nixos 26.05: python3.14-swift 2.37.1
- nixpkgs unstable: python3.13-swift 2.38.3
- nixpkgs unstable: python3.14-swift 2.38.3
- Copyright (c) 2016 OpenStack Foundation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms