commitlog: switch to fragmented buffers

So far commitlog was using contiguous buffers for storing the data that
is about to be written to disk. It was able to coalesce small writes so
that multiple small mutations would use the same buffer, but if a
muation was large the commitlog would attempt to allocate a single,
appropriately large buffer. This excessively stresses the memory
allocator and may cause memory fragmentation to become an issue. The
solution is to use fixed-size buffers of 128 kB, which is the standard
buffer size in Scylla and keep large values fragmented.
This commit is contained in:
Paweł Dziepak
2018-08-14 16:08:01 +01:00
parent 7c1add6769
commit 4469f76e7c
4 changed files with 43 additions and 27 deletions

View File

@@ -71,7 +71,7 @@ public:
return _mutation.representation().size();
}
void write(typename seastar::memory_output_stream<std::vector<temporary_buffer<char>>::const_iterator>::simple& out) const;
void write(typename seastar::memory_output_stream<std::vector<temporary_buffer<char>>::iterator>& out) const;
};
class commitlog_entry_reader {