Breadcrumbs

Configure asset notification cleanup

Introduction

For communication related to an asset, you can create messages, tasks, or markers. Others can add communication entries to assets which you have created or edited. Notification messages are then sent to inform the respective users about these changes.

With a huge number of notifications messages for different users, the system can slow down noticeably. To the prevent this, the Notification cleanup (automatic) server action exists. It is regularly executed and removes older notification messages. The conditions for removing notification messages and the execution times can be configured.

The Notification cleanup (automatic) server action is already enabled and configured, by default. Normally, no action for this module is required from your side.

You only need to configure the automatic server action:

  • to disable the automatic server action which is normally not recommended.

  • to adjust the execution parameters:

    • frequency

    • conditions which notification messages that are removed

For more information, see:


Configuration of Notification cleanup

Open module configuration

Admin-client-notification-cleanup-module-2.png
  1. Open Censhare Admin Client.

  2. Go to Configuration/Modules/Administration/Notification Cleanup

  3. Double click to open the Notification cleanup (automatic) server action.

Enable/disable the automatic server action

To disable/enable the automatic server action:

  1. Go to Enabled in General setup.

  2. To disable the automatic server action: Uncheck Enabled.

  3. Otherwise, check Enabled.

Configure execution time

The execution of the automatic server action is triggered via Cron job:

Notification-cleanup-trigger-config.png

To configure the execution times:

  1. Go to Trigger events.

  2. Enter the cron job pattern in the Cron event field.

For more information:

Configure which notifcations to keep

Notification-cleanup-deleltion-parameter.png

There are two parameters to define if a notification message is kept:

  • Max age to keep (days): If the age (days) of a notification message is less or equal then the max age to keep, the message is kept.

  • Max number / asset to keep: If the number of notification messages for an asset exceeds the entered value, notification messages are removed until number of messages is equal to max number. The server action removes the messages that exists for the longest time of period.

A notification message is removed if any of the two parameters is not fulfilled.

For example, there are 25 notifications messages for an asset. The oldest message is 7 days old. Max number / asset to keep is set to 20 messages. Max age to keep (days) is set 14 days. As of that, five notification messages are removed by the server action.

This procedure does not keep you from receiving new notifications messages. Let us say that you receive 3 new messages the next day. You now have 23 messages with a maximum age of 8 days. The rules only allow 20 messages. As of that, the server action removes the three messages which have the highest age. This then allows to keep the three newest messages because the number of messages is now 20 again.

For more information on the default values, see Default configuration.

Default configuration

  • Enabled: Yes. The automatic server action is activated.

  • Cron event:

    45 22 * * *
    

    The automatic server action is executed every day at 22:45 o'clock.

  • Max age to keep (days): 14. If a notification message is younger or equal than 14 days, it is kept.

  • Max number / asset to keep: 5. If a notification messages belongs to the five youngest notification messages of an asset, it is kept.

Manual clean up

If you are running a Censhare Server version, that does not contain the Notification cleanup (automatic) server action, you can still remove all notifications messages manually.

This can be done via Censhare Web or Censhare Client:

  1. Open the client.

  2. Search for assets with the Module/User notification asset type.

  3. Remove all Notification assets in the result list.

  4. This also removes the asset notifications stored at the Notification assets.

If a user receives a notification message and his Notifications asset does not exist, it is recreated automatically.

Background: How asset notification storage can affect system performance

For each user, all his notification messages are stored in a personal asset. Each time, a user receives a new notification message, the asset is opened and the message is added.

The personal Notification asset

Each user has one Notification assest. It has the following name: “Notification LOGIN-ID”. LOGIN-ID is the login name of the user. The asset type is Module/User notification.

In the Censhare Client, you can see the entries in Features tab in the Features (internal) section:

Censhare-Client-Features-notification-tab.png

Storage structure of an asset notification

A message notification is stored as Notification feature (id: censhare.notification) at an asset. The necessary information are stored as child features:

Censhare-Client-Features-notification-entry.png

How this way of storing notifications can be a problem

When an asset is opened, the XML representation of the asset data is created. The notification message data are then added.

If there is a lot of activity in the system, a lot of notification messages can be created and must be added. The XML representation of Notification asset can become quite large if there are many notification messages.

Each time, a part in the system wants to add a notification message in the Notification asset, it has to open the asset for the respective user. With increasing size, this slows the adding of notifications. If there are many different users, that receive notification messages, this slows down the system even more.

Removing older notification messages is the solution for this.