Setting the Blob Cache

The blob cache is a local cache of data from an unlimited storage database, also known as a "bottomless" database. Refer to Local and Unlimited Database Storage Concepts for information on unlimited storage databases.

Blob Cache Size Engine Variables

The size of the blob cache is controlled by the following engine variables:

Name

Description

maximum_blob_cache_size_mb

Specifies the maximum blob cache size per leaf node. This variable does not sync between nodes. This variable is updated when maximum_blob_cache_size_percent is changed.

maximum_blob_cache_size_percent

Sets the maximum percent of disk space that can be used by the blob cache.

Updates to the maximum_blob_cache_size_mb and maximum_blob_cache_size_percent engine variable function as follows:

  • Changing maximum_blob_cache_size_percent changes the value of maximum_blob_cache_size_mb and changes the size of the blob cache.

  • Changing maximum_blob_cache_size_mb changes the value of maximum_blob_cache_size_mb and the size of the blob cache but does not update maximum_blob_cache_size_percent.

  • The maximum_blob_cache_size_percent engine variable can be "out of date" if you set maximum_blob_cache_size_mb after setting maximum_blob_cache_size_percent.

  • On a restart, maximum_blob_cache_size_percent takes precedence, and sets maximum_blob_cache_size_mb to the corresponding value.

Note

SingleStore recommends using only one of the maximum_blob_cache_size_mb and maximum_blob_cache_size_percent engine variables at a time.

Details related to the blobs cached in the blob cache and events on those blobs are found in the information schema views MV_CACHED_BLOBS and MV_BLOB_CACHE_EVENTS.

Automatic Resizing of Blob Cache

When the disk space on the disk it’s mounted on starts getting filled up and stored files/objects need more space, the blob cache starts shrinking itself. The blob cache can shrink down to 70% of its maximum size. Anything that uses disk space (logs, trace logs, plancache, audit logs) even things outside the engine can steal space from the blob cache.

Example:

//Assume you are using a 1 TB disk and
maximum_blob_cache_size_mb = 800GB // for example
maximum_blob_cache_size_percent = 0
maximum blob cache size = 800GB
SET maximum_blob_cache_size_percent = 0.50;
//Now
maximum_blob_cache_size_mb = 500GB
maximum_blob_cache_size_percent = 0.50
maximum blob cache size = 500GB
SET maximum_blob_cache_size_mb = 800GB;
maximum_blob_cache_size_mb = 800GB
maximum_blob_cache_size_percent = 0.50
maximum blob cache size = 800GB
// On restarting the node
maximum_blob_cache_size_mb = 500GB
maximum_blob_cache_size_percent = 0.50
maximum blob cache size = 500GB

Last modified:

Was this article helpful?