Skip to content

Think-a-Tron/Memfast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Memfast

Memfast is a blazing-fast, memory-efficient in-memory key-value store built in Rust. Designed for caching and inference workloads, it offers low-latency access and high throughput with a lean binary TCP protocol. Perfect for speeding up AI pipelines or any application needing rapid key-value operations.


Features

  • High Performance: Lock-free sharded storage with dashmap and async I/O via tokio.
  • Memory Efficiency: Uses jemallocator and LRU eviction to optimize RAM usage.
  • Simple Protocol: Custom binary TCP for minimal overhead.
  • Configurable: Specify host and port at startup.

Installation

Prerequisites

  • Rust (latest stable, e.g., via rustup)

Building the Server

  1. Clone the repo:
    git clone https://github.com/Think-a-Tron/memfast.git
    cd memfast
  2. Build:
    cargo build --release

Usage

Running the Server

Start with default settings (127.0.0.1:3524):

cargo run --release

Or specify a custom host and port:

cargo run --release -- --host 0.0.0.0 --port 6969

Check available options:

cargo run --release -- --help

Protocol

memfast uses a binary TCP protocol:

  • PUT: [1] [key_len: 2] [key] [val_len: 4] [value][status: 1] (0=success, 2=memory full)
  • GET: [0] [key_len: 2] [key][status: 1] [val_len: 4] [value] (if 0) or [1] (not found)
  • DELETE: [2] [key_len: 2] [key][status: 1] (0=success, 1=not found)

Keys and values are raw bytes; key length is capped at 65KB, value length at ~4GB.


Contributing

Fork, tweak, and submit PRs! Issues and feature requests are welcome on GitHub.

About

Blazing-Fast Key-Value Store

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages