RAMdrive Log Cleaner

The RAMdrive log cleaner allows the Oracle® Enterprise Session Border Controller to remove log files proactively and thereby avoid situations where running low on RAMdrive space is a danger. Because even a small amount of logging can consume a considerable space, you might want to enable the RAMdrive log cleaner.

The RAMdrive cleaner periodically checks the remaining free space in the RAMdrive and, depending on the configured threshold, performs a full check on the /ramdrv/logs directory. During the full check, the RAMdrive cleaner determines the total space logs files are using and deletes log files that exceed the configured maximum lifetime. In addition, if the cleaner finds that the maximum log space has been exceeded or the minimum free space is not sufficient, it deletes older log files until the thresholds are met.

Not all log files, however, are as active as others. This condition affects which log files the log cleaner deletes to create more space in RAMdrive. More active log files rotate through the system more rapidly. So, if the log cleaner were to delete the oldest of these active files, it might not delete less active logs files that could be older than the active ones. The log cleaner thus deletes files that are truly older, be they active or inactive.

Applicable Settings

In the system configuration, you establish a group of settings in the options parameter that control the log cleaner’s behavior:

  • ramdrv-log-min-free—Minimum percent of free space required when rotating log files.

    When the amount of free space on the RAMdrive falls below this value, the log cleaner deletes the oldest copy of the log file. The log cleaner also uses this setting when performing period cleaning.

  • ramdrv-log-max-usage—Maximum percent of the RAMdrive the log files can use.

    The log cleaner removes old log files to maintain this threshold.

  • ramdrv-log-min-check—Minimum percent of free space on the RAMdrive that triggers the log cleaner to perform a full check of log files.
  • ramdrv-min-log-check—Minimum time (in seconds) between log cleaner checks.
  • ramdrv-max-log-check—Maximum time (in seconds) between log cleaner checks. This value must be greater than or equal to the ramdrv-min-log-check.
  • ramdrv-log-lifetime—Maximum lifetime (in days) for log files. You give logs unlimited lifetime by entering a value of 0.

Clean-Up Procedure

The log cleaner checks the amount of space remaining in the RAMdrive and performs a full check of the logs directory when:

  • Free space is less than the minimum percent of the RAMdrive that triggers a full check of log files
  • The amount of free space has changed by more than 5% of the RAMdrive capacity since the last full check
  • A full check of the logs directory has not been performed in the last hour

When it checks the logs directory, the log cleaner inventories the collected log files. It identifies each files as one of these types:

  • Process log—Files beginning with log.
  • Internal trace file—A <task>.log file
  • Protocol trace file—Call trace including sipmsg.log, dns.log, sipddns.log, and alg.log
  • CDR file—File beginning with cdr

Next, the log cleaner determines the age of the log files using the number of seconds since the log files were created. Then it orders the files from oldest to newest. The age adjusts such that it always increases as the log file sequence number (a suffix added by file rotation) increases. The log cleaner applies an additional weighting factor to produce a weighted age that favors the preservation of protocol traces files over internal trace files, and internal trace files over process log files. The base log file and CDR files are excluded from the age list and so will not be deleted; the accounting configuration controls CDR file aging.

With the age list constructed, the log cleaner examines the list from highest weighted age to lowest. If the actual file age exceeds the RAMdrive maximum log lifetime, the log cleaner deletes it. Otherwise, the log cleaner deletes files until the maximum percent of RAMdrive that logs can use is no longer exceeded and until the minimum percent of free space required when rotating logs is available.

Clean-Up Frequency

The minimum free space that triggers a full check of log files and the maximum time between log file checks control how often the log cleaner performs the clean-up procedure. When it completes the procedure, the log cleaner determines the time interval until the next required clean-up based on the RAMdrive’s state.

If a clean-up results in the deletion of one or more log files or if certain thresholds are exceeded, frequency is based on the minimum time between log cleaner checks. Otherwise, the system gradually increases the interval up to the maximum time between log cleaner checks. The system increases the interval by one-quarter of the difference between the minimum and maximum interval, but not greater than one-half the minimum interval or smaller than 10 seconds. For example, using the default values, the interval would be increased by 30 seconds.

RAMdrive Log Cleaner Configuration

You configure the log cleaner’s operating parameters and thresholds in the system configuration. Note that none of these settings is RTC-supported, so you must reboot your Oracle® Enterprise Session Border Controller in order for them to take effect. If you are using this feature on an HA node, however, you can add this feature without impact to service by activating the configuration, rebooting the standby, switching over to make the newly booted standby active, and then rebooting the newly standby system.

Unlike other values for options parameters, the Oracle® Enterprise Session Border Controller validates these setting when entered using the ACLI. If any single value is invalid, they all revert to their default values.

To configure the RAMdrive log cleaner:

  1. In Superuser mode, type configure terminal and press Enter.
    ORACLE# configure terminal
    ORACLE(configure)#
  2. Type system and press Enter.
    ORACLE(configure)# system
    ORACLE(system)#
  3. Type system-config and press Enter.
    ORACLE(system)# system-config
    ORACLE(system-config)#
  4. options—Set the options parameter by typing options, a Space, <option name>=X (where X is the value you want to use) with a plus sign in front of it. Then press Enter.

    Remember that if any of your settings are invalid, the Oracle® Enterprise Session Border Controller changes the entire group of these options back to their default settings.

    The following table lists and describes the supported options.

    • ramdrv-log-min-free—Minimum percent of free space required when rotating log files. When the amount of free space on the RAMdrive falls below this value, the log cleaner deletes the oldest copy of the log file. The log cleaner also uses this setting when performing period cleaning.
      • Default: 40
      • Minimum: 15
      • Maximum: 75
    • ramdrv-log-max-usage—Maximum percent of the RAMdrive the log files can use. The log cleaner removes old log files to maintain this threshold.
      • Default: 40
      • Minimum: 15
      • Maximum: 75
    • ramdrv-log-min-check—Minimum percent of free space on the RAMdrive that triggers the log cleaner to perform a full check of log files.
      • Default: 50
      • Minimum: 25
      • Maximum: 75
    • ramdrv-min-log-check—Maximum time (in seconds) between log cleaner checks. This value must be greater than or equal to the ramdrv-min-log-check.
      • Default: 180
      • Minimum: 40
      • Maximum: 1800
    • ramdrv-log-lifetime—Maximum lifetime (in days) for log files. You give logs unlimited lifetime by entering a value of 0.
      • Default: 30
      • Minimum: 2
      • Maximum: 9999

      Default=30; Minimum=2; Maximum=9999

    ORACLE(system-config)# options +ramdrv-log-min-free=50
    ORACLE(system-config)# options +ramdrv-log-max-usage=50
    ORACLE(system-config)# options +ramdrv-log-min-check=35
    ORACLE(system-config)# options +ramdrv-min-log-check=120
    ORACLE(system-config)# options +ramdrv-max-log-free=1500
    ORACLE(system-config)# options +ramdrv-log-lifetime=7

    If you type options and then the option value for either of these entries without the plus sign, you will overwrite any previously configured options. In order to append the new options to this configuration’s options list, you must prepend the new option with a plus sign as shown in the previous example.

  5. Reboot your Oracle® Enterprise Session Border Controller.