Settings entity is written to unnecessarily



  • Hi Jan,

    Firstly I want to say thank you for your extremely quick and helpful responses and a marvellous product.

    Using Azure Blob storage (although may switch to Mongo) - wondering if there is a way to disable JsReport from continously updating the Settings entity as it is introducing highly unnecessary Azure blob data charges. Typically once report templates have stabilised I would expect all entities to never to be written to - however I see the Settings entity is updated every 5 seconds (watching the Azure blob details) ..

    0_1556071137990_upload-a6555845-41a6-46a1-8146-7b544beb123c

    5 seconds later the Modified time changes along with the ETAG but the MD5 hash does not ..

    0_1556071211284_upload-3d62b30f-c3db-46da-a825-6c7244814ec9

    There are no reports running at this time.

    I came across this since I noticed the Azure blob account had an extremely high Objectcount of over 700,000 objects and climbing, given I can see only ~400 objects across the 5 containers in that account I started investigating and found this as the only possible explanation (so far).

    Does the Settings file even need to be persisted in the same way as the other entities ? It looks to me it contains mostly logs and errors of recently run reports - surely this can be stored locally?

    Cheers

    Steve



  • This behavior is caused by some history. The data driver external library which we were using was working this way.
    We wanted to stay compatible when we were replacing it with our own implementation so we work the same for now.

    The idea is that the updates and deletes to files like to reports, settings are not fully updating its content but instead always just appending to file.
    Imagine the reports can have 1mil of entries and you want to change one entry, you don't want to parse the whole file and persist it back.
    It is performing much better if you append the new entry to the file and once in a while load the whole file and compact it.

    We will probably reimplement this in the v3, but let's see.

    In the meantime, it is recommended to increase compactionInterval for slower stores like azure blob storage.

    "fs-store": {
          // 1min
          "compactionInterval": 60000,
          "persistence": {
            "provider": "azure-storage"
          }
        }
    }
    

    It is somewhere in the docs, but probably not in the right place, because I also can't find it now.
    I will add it there.



  • You can additionally fully disable writing the logs to settings if you don't need to have them visible in the studio/startup

    "extensions": {
      "studio": {
        "requestLogEnabled": false
      }
    }
    

Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.