compact

compact store-name max-time
compact

Compacts a specified store of type file, or all stores of type ftl. Compaction is not available for stores of type as.

For stores of type file:

  • Since compaction for file-based stores can be a lengthy operation and it blocks other operations, a time limit (in seconds) must be specified for the operation through the max-time parameter. Note that max-time must be a number greater than zero.
  • If truncation is not enabled for the store file, the compact command does not reduce the file size. Enable truncation using the file_truncate parameter in the stores.conf file. See stores.conf for more information.
  • We recommend compacting the store files only when the Used Space usage is 30% or less (see show store).

For stores of type ftl:

  • FTL stores are designed to automatically compact in the background when the underlying FTL deployment reaches a certain threshold of unused disk space. The compact command can be used to manually trigger this compaction process.
  • The store-name and max-time arguments are not supported for the compact command when using FTL stores. The compaction process occurs at the FTL level and automatically affects all FTL stores; and since the compaction process occurs asynchronously over time, a time limit is not required.