how to reduce the buffer flush timeout to write data to file?

Issue #25 closed
Pavan Reddy created an issue

Hi,

While logging CAN messages to BLF file, the file size won’t update quickly. I assume, there will be a certain timeout to update or write the data to file. If any such thing is there, then how to reduce that time out?

Comments (8)

  1. Tobias Lorenz repo owner

    Hi Pavan,

    yes, that’s exactly the problem. The variable is written delayed, when the background thread has written the data. In addition the file sizes increases in chunks, as data first need to be compressed into LogContainers.

    So V2 of the library is runtime performance optimized, so background read/write operations. With this you will always have the delay. V1 of the library works without threads and there should got get an instant increase in the numbers.

    I’ll keep this issue open as an enhancement request. It may be possible to add a low-level method to reserve space and to have immediately increase the reported file size, while the write into this space happens later in the background. I need to think about this…

    Bye

    Tobias

  2. Tobias Lorenz repo owner

    Hi Pavan,

    No, not really. The performance of v1 is ok for most applications. Only if you want to read Gigs of data, the multi-threaded version, V2, works better. V3, I’m working on, will focus on random read access to seek back and forth.

    Bye Tobias

  3. Creed Zheng

    Hi Tobias, I got an similar situation, I have changed objectqueue size to 100, and i continuously write CAN frames, before the queue is full, real disk write speed can up to 600KB/s, when the object queue is full, the write speed decrease to 120KB/s. The compress level i set to 0.I use iotop command to watch write speed.

  4. Tobias Lorenz repo owner

    Hi Creed,

    if the queue is full, then the write operation blocks. Due to that the write speed decreases.

    Bye
    Tobias

  5. Tobias Lorenz repo owner

    I think the issue is explained sufficiently. The write performance decreases as soon as the write buffer is filled. My performance analysis shows that both threads are running equally balanced. Further performance optimization is only possible with block wise read/write in all objects.

  6. Log in to comment