As explained in The Costs of Logging and System Constraints, logging of caching transactions involves system and maintenance overhead. If your situation requires logging, you should plan carefully so that the information you are tracking aligns with specific requirements. This will ensure optimal use of appliance resources.
Because logging requirements and transaction volume vary widely, it is impossible to make recommendations regarding specific logging strategies.
The following sections step you through the logging strategy planning process. We recommend you record the information you gather on a planning sheet of some kind.
To plan a logging strategy, you should first determine the requirements driving the need for logging. We recommend you complete the following steps:
Identify the business and/or other reasons for tracking service transactions.
Examples include customer billing requirements, statistical analysis, or growth planning.
Determine which services you need to track.
Record this information for later reference.
If you use the common log format, log entry size is fixed. If you use the extended log format, log entry size depends on the number of log fields selected.
Complete the following steps for each service you need to track:
Referring to the Log Options Dialog Box, record which log fields must be tracked for each service to be logged.
Carefully scrutinize the information you plan to track to ensure that the log data collected is essential. Consider the following points:
The main point is to log only the essential data because a few bytes can add up quickly when the cache device is tracking thousands of hits every second.
You can have the appliance 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:
logvol_size: The total disk capacity reserved for log files on your appliance.
You must get this information from your appliance vendor.
logentry_size: The average log entry size.
You can determine this by configuring your appliance to track the required information, generating traffic to the appliance, 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 appliance in service and get more accurate data by accessing the browser-based management tool's Monitoring tabs.
num_services: The number of services for which you plan to enable logging.
logs_per_service: The number of log files, both active and closed, that you want the appliance to generate for each service before the disk fills.
You must plan to have at least two logs per service before the disk is filled. See Log Files Must Be Rolled Over Before Deletion.
Using the following formula, you can calculate how long it will take the appliance to fill your logging disk space:
diskfull_time seconds = logvol_size / (request_rate * logentry_size * num_services)
For example, if you assume the following:
Then diskfull_time = (1 GB) / (1000 * 1KB * 1) = 1048 seconds (17.47 minutes).
The logging disk space will fill up every 17.47 minutes.
If this time is too short, you must reduce the log entry size by configuring the appliance to log less information per transaction. This is because you can't increase the disk space nor limit the requests being logged.
To calculate the diskfull_time for your appliance, complete the following steps:
Determine the values of the four variables listed above.
For more information, refer to Variable Definitions.
Using the diskfull_time formula, calculate how often you can expect your logging disk to fill; then use the result in Calculating MAX_ROLL_TIME.
Using the following formula, you can calculate the maximum roll-over time value you should specify in the Rollover Every field of the Log Options dialog box.
max_roll_time = diskfull_time / logs_per_service
For example, if you assume the following:
Then 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 appliance, complete the following steps:
Determine how many log files you want the appliance to generate per service before log space fills.
The minimum number is two.
Using the max_roll_time formula and the diskfull_time value obtained in Calculating DISKFULL_TIME, calculate how often you should have the appliance roll over the log files.
Record the max_roll_time result on your planning sheet.
Using the following formula, you can calculate the maximum log file size you should specify in the Rollover When File Size Reaches field of the Log Options dialog box.
max_log_roll_size = logvol_size / (num_services * logs_per_service)
For example, if you assume the following:
Then 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 will run out of disk space before you have three complete log files and scheduling the download and deletion of log files will be much more complex.
To calculate the max_log_roll_size for your appliance, complete the following steps:
Determine the values of the three variables listed above.
Using the max_log_roll_size formula, calculate the maximum size a log file should reach before the appliance rolls it over.