# When are files in 'blobs' directory that are no longer valid cleaned up?

**URL:** <https://www.singlestore.com/forum/t/when-are-files-in-blobs-directory-that-are-no-longer-valid-cleaned-up/6662>\
**Category:** Uncategorized\
**Created:** [April 3, 2023, 3:38am UTC](https://www.singlestore.com/forum/t/when-are-files-in-blobs-directory-that-are-no-longer-valid-cleaned-up/6662 "2023-04-03T03:38:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyoungho.kum](https://www.singlestore.com/forum/letter_avatar_proxy/v4/letter/k/8e7dd6/32.png) [@kyoungho.kum](https://www.singlestore.com/forum/u/kyoungho.kum)\
**Post date:** [April 3, 2023, 3:38am UTC](https://www.singlestore.com/forum/t/when-are-files-in-blobs-directory-that-are-no-longer-valid-cleaned-up/6662/1 "2023-04-03T03:38:43Z")

</div>

Hi everyone,

When are files in ‘blobs’ directory that are no longer valid cleaned up?

I confirmed that it was cleaned up when I ran snapshot.  
Besides this, are there any other events?

In other words, I wonder when the GC is triggered.

Best regards,  
KH.

---

<div class="post-metadata">

**Author:** ![hanson](https://www.singlestore.com/forum/user_avatar/www.singlestore.com/hanson/32/196_2.png) [@hanson](https://www.singlestore.com/forum/u/hanson)\
**Post date:** [April 3, 2023, 11:42pm UTC](https://www.singlestore.com/forum/t/when-are-files-in-blobs-directory-that-are-no-longer-valid-cleaned-up/6662/2 "2023-04-03T23:42:34Z")

</div>

Which directory specifically? There are several directories that contain blobs.

You mentioned snapshots, so maybe that’s what you’re talking about. SingleStore automatically cleans up old snapshots as part of its normal operation.

The engine variable `snapshot_trigger_size` sets a threshold for the transaction log’s size (in bytes) that must be reached before the next snapshot is taken ([SNAPSHOT DATABASE · SingleStore Documentation](https://docs.singlestore.com/db/v8.0/en/reference/sql-reference/operational-commands/snapshot-database.html#remarks-653722)). Old snapshots are cleaned up automatically over time as new snapshots are taken.

Keep in mind that if your snapshot directory is growing without control, you may need to increase your disk space or consider adjusting the `snapshots-to-keep` configuration to limit the number of snapshots retained([The snapshot directory has a lot of capacity](https://www.singlestore.com/forum/t/the-snapshot-directory-has-a-lot-of-capacity/2094)).

---

<div class="post-metadata">

**Author:** ![kyoungho.kum](https://www.singlestore.com/forum/letter_avatar_proxy/v4/letter/k/8e7dd6/32.png) [@kyoungho.kum](https://www.singlestore.com/forum/u/kyoungho.kum)\
**Post date:** [April 5, 2023, 5:15pm UTC](https://www.singlestore.com/forum/t/when-are-files-in-blobs-directory-that-are-no-longer-valid-cleaned-up/6662/3 "2023-04-05T17:15:44Z")

</div>

Hi,

These are segment files in the “\<node\_base\_directory\>/data/blobs/” directory.  
Even if a table is truncated or dropped, the table’s segment files here still exist.

I would like to know when it will be removed.  
I have “snapshot database …;” I confirmed that it was removed by running the command.  
Are there other events that trigger file remove?

Best regards,  
KH.

---

<div class="post-metadata">

**Author:** ![hanson](https://www.singlestore.com/forum/user_avatar/www.singlestore.com/hanson/32/196_2.png) [@hanson](https://www.singlestore.com/forum/u/hanson)\
**Post date:** [April 10, 2023, 10:09pm UTC](https://www.singlestore.com/forum/t/when-are-files-in-blobs-directory-that-are-no-longer-valid-cleaned-up/6662/4 "2023-04-10T22:09:34Z")

</div>

Oh, okay. Columnstore data blobs in the “\<node\_base\_directory\>/data/blobs/” directory will be deleted asynchronously after `snapshots_to_keep` snapshots have been taken on the database since the data in the data in the blob was deleted.

If you run additional [snapshots](https://docs.singlestore.com/managed-service/en/reference/sql-reference/operational-commands/snapshot-database.html), to pass the `snapshots_to_keep` threshold, then the cleanup of blogs eligible to be deleted will start within a few seconds. This is not necessary – you should just wait for snapshots to happen naturally.
