I am developing an application, where I have large data that's continuously been write into ram, and I am trying to quickly read the data out from ram, and write it into NVMe SSD, after write is completed, I re queue ram space to allow it being written.
My current issue is that the data write continuously in an indefinitely time, so eventually my RAM is not large enough to host all the data, it has to be readout and store into disk. Due to the size of data, the write speed criteria is high ( 1.5G/s).
I often see mmap be mentioned to improve I/O efficiency, but mostly read efficiency because it prevents copy large data to DRAM. So I wonder in my use case, is it beneficial to use mmap to map my SSD directly as virtual memory and directly write to it be faster than standard fwrite ?