Skip to content

In Memory File System

feiben edited this page Mar 7, 2016 · 12 revisions

In real time mode, LunarMax maintains an in-memory light-weighted file system for quick access of data, avoiding most of the random disk access. Apparently, Real time mode consumes more memory than normal mode. LunarMax allocates memory by its internal lmalloc, a thing quite similar to the Linux default implemented malloc.

Of course data in memory is compressed, but if there are no sufficient memory to use, lmalloc uses external disk space for data swapping. In this situation, the performance will be slow down, so please make sure you have enough memory space for this mode. We have an estimation of consumption:

one column, e.g. int:payment, and each record has size limitation up to 32 KB:  
1M records (with size up to 32GB) need about 50M memory space  
10M records (with size up to 320GB) need about 500M memory space  
100M reords (with size up to 3200GB) need about 5000M memory space  
...

More columns definitely cost more memory space, but linearly. You shall prepare a server with, say 100GB, memory if you will have billions of records to process in real time.

LunarMax supports using extra disk as memory just like what modern operation system does. Consult this mode (rt_virtual_mem_enabled = on)[https://github.com/LunarBaseEngin/Application/wiki/Real-Time-Configuration] for how to replace the default OS virtual memory system, and use an extra SSD space as much more cheaper memory.

Clone this wiki locally