Hasty Briefsbeta

Bilingual

<antirez>

8 hours ago
  • Redis traditionally uses a single-threaded model with background I/O threads; the blocking DEL command can freeze the server for seconds on large keys.
  • An initial incremental freeing approach used a timer to free memory gradually, adapting to memory pressure, but reduced performance to about 65% of normal.
  • The final solution moved to a threaded lazy free implementation, which required eliminating shared robj structures from data types and client output buffers.
  • Key changes include using dynamic strings in output buffers and SDS strings in data types, leading to faster performance and better memory efficiency.
  • A new UNLINK command provides non-blocking deletion; FLUSHALL/FLUSHDB also gain lazy options.
  • Future plans include threaded I/O and key-level locking for slow operations, moving toward a share-nothing design.
  • The lazy free branch is currently under active development and targeted for Redis 3.4.