javalotus-noteslotus-domino

How to speed up frequent writing


we created an java agent which does a check on our application suite to see if for instance the parent/child structure is still correct. Therefore it needs to check for 8000+ documents accros several applications.

The check itself goes very fast. We use a navigator to retrieve data from views and only read data from those entries. The problem is within our logging mechanism. Whenever we report a log entry with level SEVERE ( aka: A realy big issue ) the backend document is directly updated. This is becuase we dont want to lose any info about these issues.

In our test runs we see that everything runs smooth but as soon as we 'create' a lot of severe issues the performance drops enormously because of all the writes. I would like to see if there are any notes developers facing the same challenge.. How couuld we speed up the writing without losing any data?

-- added more info after comment from simon --

Its a scheduled agent which runs every night to check for inconsistencies. Goal is ofcourse to find inconsistencies and fix the cause and to eventualy have no inconsistencies reported at all.


Solution

  • Its a scheduled agent which runs every night to check for inconsistencies.

    OK. So there are a number of factors to take into account.

    1. Are there any embedded Jars? When an agent has embedded jars the server has to detach them from the agent to the disk before they can run the code. This is done every time the agent executes. This can be a performance hit. If your agent spawns a number of times, remove the embedded jars and put them into the lib\ext folder on the server instead (requires server restart).

    2. You mention it runs at night. By default general housekeeping processes run at night. Check the notes ini for Server Tasks scheduled and appraise what impact they have on the server/agent when running. For example:

      ServerTasksAt1=Catalog,Design
      ServerTasksAt2=Updall
      ServerTasksAt5=Statlog
      

      In this case if ran between 2-5 then UPDALL could have an impact on it. Also check program documents for scheduled executions.

    3. In what way are you writing? If you are creating a document for each incident and the document contents is not much then the write time should be reasonable. What is liable to be a hit in performance is one of the following.

      • If you are multi threading those writes.
      • Pulling a log document, appending a line, saving and then repeating.

    One last thing to think about. If you are getting 3000 errors, there must be a point where X amount of errors means that there is no point continuing and instead to alert the admin via SNMP/email/etc? It might be worth coding that in as well.

    Other then that, you should probably post some sample code in relation to the write.