Calculating Rollover Requirements

You can have Access Gateway roll over log files based on time or on size, but not both. If you already know which option you want to use, scan this section and then complete only the calculations pertinent to your choice. If you don’t know which option best matches your situation, completing the calculations in this section should help you decide.

The following variables are used in the formulas:

  • logpartition_size: The total disk capacity reserved for log files on Access Gateway.

    Access Gateway reserves 4 GB to share between logging and system files. The system files do not grow significantly, so you can assume that you have about 2 GB for logging. To increase this size, see Configuring the Size of the Log Partition.

  • logentry_size: The average log entry size.

    You can determine this by configuring a proxy service to track the required information, generating traffic to the proxy service, downloading the log files, determining how large each entry is, and calculating the average.

  • request_rate: The peak rate of requests per second.

    You can estimate this rate or place your Access Gateway in service and get more accurate data by accessing generated statistics. See Monitoring Access Gateway Statistics.

  • num_services: The number of proxy services for which you plan to enable logging.

  • logs_per_service: The number of log files, both active and closed, that you want Access Gateway to generate for each proxy service before the disk fills.

    You must plan to have at least two logs per proxy service, but you can have more.

The following formulas can help you estimate when the system would run out of resources:

Calculating diskfull_time

Use the following formula to calculate how long it takes Access Gateway to fill your logging disk space:

diskfull_time in seconds = logpartition_size / (request_rate *
   logentry_size * num_services)

For example, assume the following:

  • logpartition_size = 1 GB (1,073,741,824 bytes)
  • request_rate = 1000 requests per second
  • logentry_size = 1 KB (1,024 bytes)
  • num_services = 1
diskfull_time = (1 GB) / (1000 * 1 KB * 1) = 1048 seconds (17.47
   minutes)

The logging disk space fills up every 17.47 minutes.

To calculate the diskfull_time for your Access Gateway:

  1. Determine the values of the four variables listed above.

  2. Use the diskfull_time formula to calculate how often you can expect your logging disk to fill, then use the result in Calculating max_roll_time.

If your diskfull_time interval is too short to be practical for your rollover schedule, the easiest option is to reduce the log entry size by configuring the proxy services to log less information per transaction.

Calculating max_roll_time

Use the following formula to calculate the maximum rollover time value to be specified in the Roll over every field:

max_roll_time = diskfull_time / logs_per_service

For example, assume the following:

  • diskfull_time = 12 hours
  • logs_per_service = 2
max_roll_time = 12 / 2 = 6 hours

If you roll your logs over by time intervals, the maximum time should be less than six hours. Otherwise, scheduling the download and deletion of log files is much more complicated and the window in which this can be done is narrower.

To calculate the max_roll_time for your Access Gateway:

  1. Determine how many log files you want Access Gateway to generate per service before log space fills.

    The minimum number is two.

  2. Use the max_roll_time formula and the diskfull_time value obtained in Calculating diskfull_time to calculate how often you should have the cache device roll over the log files.

  3. Record the max_roll_time result on your planning sheet.

Calculating max_log_roll_size

Use the following formula to calculate the maximum log file size you should specify in the Maximum File Size field:

max_log_roll_size = logpartition_size / (num_services *
   logs_per_service)

For example, assume the following:

  • logpartition_size = 600 MB
  • num_services = 2
  • logs_per_service = 3
max_log_roll_size = 600 MB / (2 * 3) = 100 MB

If you roll your logs over when they reach a specific size, the file size must be no more than 100 MB. Otherwise, the system runs out of disk space before you have three complete log files and scheduling the download and deletion of log files is much more complex.

To calculate the max_log_roll_size for your Access Gateway:

  1. Determine the values of the three variables listed above.

  2. Use the max_log_roll_size formula to calculate the maximum size a log file should reach before the cache device rolls it over.