fbpx

Scylla University LIVE | Free Virtual Training Event | July 28 & July 29

Scylla U Sticky Banner icon
Pick Your Timezone >

Scylla Memory Management

Scylla takes full advantage of all available memory to provide blazing-fast query response times with consistently low latencies.

How Scylla Maximizes the Usage of Memory

How Scylla Maximizes the Usage of Memory

During startup, Scylla inspects the node’s hardware and tries to claim all available memory for itself (apart from that reserved to the operating system), as memory is the most critical resource for any NoSQL database. The allocated memory is divided and assigned to each of the single threaded shards running in the node, each pinned to a different CPU core. This approach allows Scylla to efficiently allocate memory to each CPU’s core in a shared-nothing NUMA-friendly manner and avoid any typical blocking operations or memory locks, and is referred to as lock-free memory management.

NOTE: In a shared environment this can severely impact performance or execution of other running applications. In such deployments users can configure a limit to the amount of memory Scylla consumes.

Memtable and Row-Based Cache

Memtable and Row-Based Cache

One major section of memory allocated within Scylla is for the memtable, an in-memory structure used on the write path to queue incoming writes and updates before they are flushed to a persistent SSTable on disk. Note, the same data is immediately written to the commitlog for durability.

The second section is for a row-based cache. Normally, in Linux based operating systems, data is fetched in 4KB blocks from storage. However, in practice, many database reads are fetching far less data. This results in read amplifications and inefficiency of the Linux cache. By contrast, Scylla completely bypasses the Linux cache during reads and leverages its own highly efficient row-based cache.

Memory allocation in Scylla is dynamic and as-needed. There are no static blocks or reserved set-asides. For example, in a read-only workload, cache will consume all of the memory. If writes start, memory will be reclaimed from cache and used for creation of memtables.

Learn more About Scylla’s Memetables and Row-Based Cache

In-Memory Tables

Scylla Enterprise and Scylla Cloud allow users to take advantage of one more unique type of data structure: in-memory tables. These are standard CQL-queryable SSTables stored in RAM. While Scylla from NVMe SSD already provides consistently-low millisecond-scale latencies, running tables in-memory is an order of magnitude faster, with p99 latencies measured in hundreds of µseconds (microseconds). For resiliency Scylla’s in-memory NoSQL tables are also persisted to SSTables on disk over time.

Learn more About Scylla’s In-Memory Tables

Scylla University Mascot

Scylla University

Get started on the path to Scylla expertise

Scylla Cloud Mascot

Scylla Cloud

It’s easy to get started with our NoSQL DBaaS