0

in filex example file, given to fx_fault_tolerant_enable function RAM buffer in size of FX_FAULT_TOLERANT_MAXIMUM_LOG_FILE_SIZE which is 3K.

I would want to reduce this define and the RAM buffer as much as I can.

What are the parameters I need to decide what is the needed size for FX_FAULT_TOLERANT_MAXIMUM_LOG_FILE_SIZE? can I reduce the RAM buffer more?

I suppose it should be some function of how many open files I have in parallel and how much I am writing to them but I don't know how to really calculate it.

EDIT

In the read fault tolerance function it looks like it is expected that the cache size is at least the size of the log in the file system, for example if FX_FAULT_TOLERANT_MAXIMUM_LOG_FILE_SIZE is 3K so the cache is also at least 3K. Am I right??

jack
  • 1
  • 2

1 Answers1

1

The requirement of RAM buffer size for fault tolerant feature is at least bytes_per_sector. The symbol FX_FAULT_TOLERANT_MAXIMUM_LOG_FILE_SIZE is not user configurable. It covers the worst case of file renaming. The log file will occupy 3K data in the file system. Do you intend to save disk usage for fault tolerant?

  • thanks Tiejun, is there is some way to occupy less than 3K data for the log, for example by reducing max long file name or by having assumptions on max file sizes? – jack May 24 '21 at 05:01
  • Could you tell the reason why you need to reduce the size of fault tolerant log file? – Tiejun Zhou May 25 '21 at 06:17
  • well, because I have too much data I need to store in the file system and not big enough disk, so I need to save space wherever I can. One of the big reasons to use filex is that it suppose to have little fingerprint. – jack May 25 '21 at 10:10
  • Well, in this case you need to modify the value of FX_FAULT_TOLERANT_MAXIMUM_LOG_FILE_SIZE manually. The calculation of maximum usage is as complicated as stack usage. One way to detect the maximum usage is to define FX_FAULT_TOLERANT_MAXIMUM_LOG_FILE_SIZE to 512 initially. If your application runs successfully, then it is good. Or else, increase the value by 512 until success. – Tiejun Zhou May 26 '21 at 01:21
  • please see the edit in the question, it looks to me your answer is wrong, am I right? – jack Jun 09 '21 at 10:58
  • No. The requirement of fault tolerant cache size is at least one sector size. The following piece of code is calculating how many sectors can be read into fault tolerant buffer. sectors = media_ptr -> fx_media_fault_tolerant_memory_buffer_size / media_ptr -> fx_media_bytes_per_sector – Tiejun Zhou Jun 11 '21 at 01:02