In a lucid flash he realized that his soul could not bear the weight of so many past events, and that memories of his own and others pierced his heart like long, deadly hairs. He could not help admiring the calm cross-webbing of withered roses, the tenacity of weeds and wheat, the calm of the bright air of a February morning. One Hundred Years of Solitude

How do I write messages to CommitLog files with near-memory write performance

The Broker is based on OS PageCache and sequential write mechanisms to improve CommitLog writing performance

First, the Broker writes messages to CommitLog files sequentially, apending one data at the end of each write. Sequential writes to files perform much better than random writes to files

In addition, data is written to the CommitLog file, not directly to the underlying physical disk file, but to the OS PageCache cache, and then the OS background thread selects a time to asynchronously brush the OS PageCache cache data to the underlying disk file