C H A P T E R 4 |
Releasing |
Releasing is the process by which the releaser makes disk cache space available by identifying archived files and releasing their disk cache copy. This makes room for other files to be created or staged from archive media. The releaser can release only archived files. A released file has no data on the disk cache.
The Sun StorEdge SAM-FS software automatically invokes the releaser process when a site-specified disk threshold is reached. Alternatively, you can use the release(1) command to release a file's disk space immediately or to set releasing parameters for a file.
You can also specify that files be released immediately after archiving, that files never be released, or that files be partially released.
This chapter describes the releasing process and releaser operations. It contains the following sections:
When file system utilization exceeds its configured high water mark, the file system management software invokes the releaser, which does the following:
1. Reads the releaser.cmd file and collects the directives that control the release process.
2. Scans the file system and collects information about each file.
3. Begins releasing files in priority order.
A file system can contain thousands of files. Keeping track of the release priority for every file can be wasteful because releasing only several large files might return the file system to its low water mark. However, the releaser must examine the priority of each file or risk missing the best candidates for release. The releaser does this by identifying the first 10,000 candidates. It then discards subsequent candidates if they do not have a priority greater than the lowest-priority candidate among the first 10,000.
After the releaser has determined the priority of the first 10,000 candidates, it selects the files with the highest priority for release. After releasing each file, the releaser checks whether the file system cache utilization is below the low water mark. If so, it stops releasing files. If not, it continues releasing the files in priority order.
If the releaser has released all 10,000 candidates and the file system is still above the low water mark, it starts over and identifies 10,000 new candidates.
The releaser exits if it cannot find any viable candidates. This can occur, for example, if files do not yet have archive copies. If this happens, the Sun StorEdge SAM-FS software starts the releaser again after one minute has elapsed.
The high and low water marks are set with the high=percent and low=percent file system mount options. For more information about these mount options, see the mount_samfs(1M) man page.
This section describes concepts that are basic to the releaser process:
You can view these times by using the sls(1) command with the -D option. Each time has a corresponding age. For example, if it is 10:15 a.m., a file with a modify time of 10:10 a.m. has a data-modified age of five minutes. For more information about the sls(1) command, see the sls(1) man page.
Candidate files with numerically larger priorities are released before candidates with numerically smaller priorities.
Releasing and staging are complementary processes. Files can be completely released from online disk cache after they are archived, or a site can specify that the beginning of a file (the stub) remain in disk cache while the remainder of the file is released. Partially releasing a file provides immediate access to data in the file stub without requiring that the file be staged first.
As system administrator, you can specify both the default partial release size and the maximum size of the stub to remain online when a file system is mounted. You can set these through the mount(1M) command or in the File System Manager software. See the File System Manager online help for more information.
The mount(1M) command options are as follows:
You can specify the default stub size for a file by specifying the -p option on the release(1) command or the p option on the sam_release(3) library routine. To specify different-sized file stubs for different types of files or different applications, a user can specify the -s option on the release(1) command or the s option on the sam_release(3) library routine. The -s and s values must be less than the -o maxpartial value used with the mount(1M) command when the file system was mounted.
Another mount option, -o partial_stage=n, allows a system administrator to establish how much of a partial release stub must be read before the rest of the file is staged. Reading past the -o partial_stage=n size specification initiates the stage of the file.
By default, the -o partial_stage=n option is set to the size of the partial release stub. Changing this value affects file staging as follows:
For example, assume that the following options are in effect:
The filemgr(1) program reads the first 8 kilobytes of a file. The file is not staged. A video-on-demand program reads the same file, and the file is staged after it reads past the first 16 kilobytes of the file. The application continues reading the 2 gigabytes of disk data while the archive tape is mounted and positioned. When the video-on-demand program reads past 2 gigabytes of file data, the application reads immediately behind the staging activity. The application does not wait because the tape mounting and positioning is done while the application reads the partial file data.
Several command-line options affect whether a file can be marked for partial release. Some options are enabled by the system administrator, and others can be enabled by individual users. The following sections describe the release characteristics that can be set by the various types of users.
As system administrator, you can change the maximum value and default value for partial release when the file system is mounted. The mount(1M) options in TABLE 4-1 affect partial release. For more information about the mount(1) command, see the mount_samfs(1M) man page.
As system administrator, you can set maximum and default values for the size of a file stub that can remain in disk cache after the file is released. You can also determine whether the partial release feature is enabled for a particular file system.
By using the release(1) command and the sam_release(3) library routines, however, a user can set other release attributes and can specify the files to be marked for partial release. The command and library options that determine partial release attributes are shown in TABLE 4-2. For more information about the release(1) command, see the release(1) man page. For more information about the sam_release(3) library routine, see the sam_release(3) man page.
The /etc/opt/SUNWsamfs/releaser.cmd file consists of directive lines that specify site-specific releasing actions. The releaser.cmd file can contain directives for setting the release priority, specifying a log file, and other actions.
The following subsections describe the releaser.cmd directives:
For more information about these directives, see the releaser.cmd(4) man page.
Some global releasing directives can be configured using the File System Manager software. See the File System Manager online help for more information.
Files are released from a file system according to a priority order determined by directives defined in the releaser.cmd file. Both file age and file size are considered. By default, sites release the largest, oldest files first, leaving the smallest, newest files on disk. The following sections show how the releaser considers a file's age and size when determining the release priority of files in a file system.
For additional information about releaser directives, see the releaser.cmd(4) man page.
The releaser considers the following possible ages when determining the age-related component of a file's release priority:
By default, the age of a file is the more recent of the file's three ages.
In some cases, a simple age derived from the most recently accessed time, modified time, and residence-changed time is preferred. In other cases, you might want the access age of a file to take precedence over the modification age. You can use directives to specify that a weighted age priority be used when calculating the release priority for a file.
CODE EXAMPLE 4-1 shows the formats of the age priority directive.
weight_age = float weight_age_access = float weight_age_modification = float weight_age_residence = float |
This directive cannot be specified in conjunction with the weight_age_access, weight_age_modification, or weight_age_residence directives.
These directives cannot be specified in conjunction with the weight_age directive.
If the weight_age_access, weight_age_modification, and weight_age_residence directives are all used, the age-related priority for a file is calculated as follows:
1. File age data is gathered for each file's possible age.
2. File age data is multiplied by the weighting factors specified in the releaser.cmd file.
3. The products of the multiplication are added together, as shown in the following equation.
CODE EXAMPLE 4-2 shows lines in a releaser.cmd file specifying that only the file's residence age be considered, and that the modification age and the access age be ignored, when the release priority of a file is calculated.
weight_age_residence = 1.0 weight_age_modify = 0.0 weight_age_access = 0.0 |
After a file's age-related priority is calculated, it is multiplied by the file's size-related priority. The size-related priority is calculated as described in the following section.
The releaser considers a file's size when determining the size-related component of a file's release priority. The size of the file (in 4-kilobyte blocks) is multiplied by the weight specified for the weight_size directive to determine the size-related component of a file's release priority.
The format of the weight_size directive is as follows:
For float, specify a floating-point number from 0.0 through 1.0. By default, float = 1.0.
CODE EXAMPLE 4-3 shows a releaser.cmd file specifying that the file size is to be ignored for all files in the samfs1 and samfs2 file system when the release priority of a file is calculated.
You can use the fs = family-set-name directive in the releaser.cmd file to indicate that the directives that follow the fs = directive apply only to the named file system.
This directive has the following format:
For family-set-name, specify the name of a family set in the mcf file.
Directives preceding the first fs = directive are global and apply to all file systems. Directives following the fs = directive override global directives. The directives described in this chapter can be used either as global directive or as directives specific to one file system.
The releaser.cmd(4) man page includes examples of the fs = directive.
The no_release and display_all_candidates directives can be useful for tuning or debugging the releaser. These directives are as follows:
This directive has the following format:
This directive has the following format:
These directives are helpful during debugging because the releaser writes the names of release candidates to the log file, but it does not physically release them from the file system.
The min_residence_age directive enables you to specify the minimum amount of time that a file must reside in a file system before it becomes a candidate for release.
This directive has the following format:
For time, specify a time in seconds. The default time is 600, which is 10 minutes. There is no practical minimum or maximum time setting.
If a logfile directive is specified in the releaser.cmd file, the releaser either appends its activity log to the indicated file, or creates the file if it does not exist.
This directive has the following format:
For filename, specify the name of a log file.
CODE EXAMPLE 4-4 shows a sample log file (some lines have been wrapped to fit on the page).
The releaser(1M) man page describes the information contained in the log file. Because the size of the log increases with each releaser run, you should plant to rotate the log file, or omit the logfile keyword.
By default, files marked for rearchiving are released. If the rearch_no_release directive is specified in the releaser.cmd(4) file, the releaser does not release the files marked for rearchiving. This directive has the following format:
You can use the list_size directive to specify the number of releaser candidates. If you notice that the releaser makes multiple file system scans before it releases the number of files needed to get to the low water mark, you might want to consider raising this value to a level greater than the default of 10,000. This might occur in a file system that contains many small files. You can get information about releaser activities from the releaser log file.
This directive has the following format:
For number, specify an integer from 10 through 2,147,483,648.
Most directives in the archiver.cmd file affect archiving, but the archive set assignment directive enables you to specify release attributes that apply to all files in an archive set.
TABLE 4-3 shows archive set assignment values that pertain to releasing.
For more information about these and the other archiver.cmd directives, see Archiving.
It is necessary to decide the characteristics of files in cache for your site. It is wasteful to load a tape if you are staging only a few kilobytes, so you may want to configure your system to retain small files in cache. CODE EXAMPLE 4-5 shows the directives to use in the releaser.cmd file to release the largest files first.
Alternatively, you might want to retain recently modified files in cache, since a recently modified file might be modified again soon. This avoids the overhead involved when the file is staged to enable modification. In this case, use the second set of age weights. CODE EXAMPLE 4-6 shows the directives to use in the releaser.cmd file to weight files from the oldest modified to the most recently modified.
weight_size = 0.0 weight_age_access = 0.0 weight_age_modify = 1.0 weight_age_residence = 0.0 |
However, most situations are not this straightforward.
Assume that you want to release the largest files first. There are hundreds of small files that are the same size, and there are several large files. Eventually, the releaser releases all the large files. If weight_age = 0.0 is specified, the releaser then releases the small files in essentially random order because they are all the same size and have the same release priority.
In this scenario, you could set weight_age = 0.01 in order to release the oldest of the equally-sized small files first.
Alternatively, you might set weight_size = 1.0 and weight_age = 0.01.
These directives violate the largest-first policy by counting smaller, less recently accessed files as better candidates than larger, more recently accessed files. However, you can reduce this effect by making weight_age smaller than weight_size.
For example, with the previous settings, a 4-kilobyte file that was staged 100 minutes ago and an 8-kilobyte file that was just staged both have the same release priority However, if you set weight_age = 0.001, a 4-kilobyte file must have been staged 1,000 minutes ago to have the same priority as the 8-kilobyte file that was just staged.
For assistance in adjusting priority weights, you can use the no_release and display_all_candidates directives and run the releaser manually to obtain a list of candidates in priority order.
From time to time, you might want to run the releaser manually. For this, you need to know the mount point of the file system and the low water mark that you want the releaser to reach.
For example, to release files in the /sam1 file system until it reaches 47 percent full, log in as root and type the following:
Command-line options override options specified in the releaser.cmd file. As the releaser runs, it writes information to your screen and to the releaser log file, if one is specified in the releaser.cmd file. For more information, see the sam-releaser(1M) man page.
Copyright © 2006, Sun Microsystems, Inc. All Rights Reserved.