Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In swift, how many objects can a container hold?

In swift, how many files can a container hold, is there any limit about this? I've tried google this question but haven't got an answer, help!

like image 859
chncwang Avatar asked Feb 15 '23 22:02

chncwang


2 Answers

Adrian Otto blogged about this a while ago: http://adrianotto.com/2010/09/openstack-os-is-great-for/

Don’t store unlimited objects per container

You can store as many objects in a container as you wish. However, your per-object upload latency will increase considerably one you reach a certain point. I found the optimal number of objects per container to be just under one million. This number will vary depending on your equipment, and how heavy of a workload it’s subjected to.

like image 195
tvb Avatar answered Mar 07 '23 07:03

tvb


I believe there is no explicit limit on the number of files. However there are some inherent restrictions from the design of Swift.

Swift takes advantage of MD5 hash for identifying objects. The size of a MD5 hash is 128-bit long which means that when the number of files exceed 2^64 the collision of MD5 is going to happen with high probability. If the collision happens, the two different objects will replace each other. Therefore you may consider 2^64 a limit.

like image 21
onemouth Avatar answered Mar 07 '23 06:03

onemouth