Skip to main content

Capacity and Quota

File and directory size

Do not use the du command on JuiceFS directories, although it's not needed from the beginning, as directory size is already a recursive sum of all its content, simply run ls -alh or view directly from the web console to see the total size of directories. If you were to use du against a JuiceFS directory, the result will be a erroneous duplicated sum.

The directory size being a recursive sum is a feature provided exclusively by JuiceFS Enterprise Edition, which allows you to easily check the directory size in large-scale scenarios. JuiceFS Community Edition does not have this feature, but you can achieve a similar function by enabling the "Directory Statistics".

In JuiceFS, file system usage is calculated 4KB-aligned, i.e. files smaller than 4KB is counted as 4KB, the minimum billing size.

To check details on files and directories, use juicefs info, for example, to display statistics for a directory:

$ juicefs info -r /jfs/logs
/jfs/logs:
inodes: 4 # the total number of inodes in the current directory
directories: 2 # the number of directories
files: 2 # the number of files
chunks: 44 # the number of chunks contained in all files
length: 2.91G # the total actual sizes of all files
size: 2.91G # billing size, all files and directories will be aligned to 4KB, which is the minimum billing unit

Above information is also directly available from the web console, with advanced visualizations as well, for example, to see the usage of the multi-level directory, you can switch to the chart to view the distribution of the entire file system by clicking the icon at the top right of the file list:

sunburst-graph-icon

A total of 4 layers of paths are counted, and it can be seen at a glance which path has the largest capacity and which path has the most inodes.

fs-sunburst-graph

File system capacity and quota

Use df -h to view the total capacity and usage of the file system. Due to the existence of fragmentation and trash, the file system usage may be less than object storage usage.

$ df -h -t fuse.juicefs
Filesystem Size Used Avail Use% Mounted on
JuiceFS:jfs1 80T 10T 70T 13% /jfs1
JuiceFS:jfs2 90T 20T 70T 22% /jfs2

Note that the total size displayed by df is the sum of used and available sizes, and the available size is calculated by subtracting space used by all your volumes, from the storage capacity of your current pricing plan. Therefore, the available sizes displayed in the df command is the same for different file systems, and all file systems "share" the remaining storage space.

If you've created multiple file systems, and wish to set individual quota on their capacity, you can do so at the web console:

file-system-quota

As shown above, you can set quota on file system root directory (this will limit the capacity on file system level, and is reflected dynamically on df -h results), as well as applying quota to individual sub-directories.