21.2 Configuring Compression for a Server

The server’s compression parameters govern compression behavior for all NSS volumes on your server. The server-level settings apply to all files and directories in compression-enabled NSS volumes, but some settings can be overridden by individual file or directory attributes.

Before you set parameters, make sure you understand how compression works for NSS. For information, see Section 21.1, Understanding Compression.

21.2.1 Understanding Server-Level Compression Parameters

The following table describes each compression parameter, its purpose, supported values, and default value.

Table 21-1 Explanation of Compression Parameters

Parameter

Description

Days Untouched Before Compression

Specifies the number of days the system waits after a file was last accessed before it is compressed. The parameter uses the date the file was last accessed for reading or writing to determine if a file is inactive, and therefore, eligible for compression. When background compression starts, it first evaluates which files meet this inactivity requirement to determine which files are to be compressed during the compression period.

To effectively stop compression for a volume, set the elapsed time very high. Eventually, files are decompressed and remain uncompressed because they never cross the inactivity threshold.

Range: 0 to 100000

Default: 14

Compression Daily Check Starting Hour

Specifies the hour when you want the file compressor to start scanning enabled volumes for files that need to be compressed and to compress them.

If the Compression Daily Check Stop Hour parameter is the same as the Compression Daily Check Starting Hour, then the file compressor starts checking every day at the Compression Daily Starting Hour time and runs as long as necessary to finish all files that meet the compressible criteria.

Range: 0 to 23

Hours are specified by a 24-hour clock: (0=midnight; 23=11 p.m.).

Default: 0

Compression Daily Check Stop Hour

Specifies the hour when you want the file compressor to stop scanning enabled volumes for files that need to be compressed and to stop compressing them.

Range: 0 to 23

Hours are specified by a 24-hour clock: (0=midnight; 23=11 p.m.).

Default: 6

Enable File Compression

Specifies whether file compression is enabled or suspended for all volumes where the Compression attribute is enabled. After an NSS volume’s Compression attribute is enabled, it cannot be turned off because the volume contains compressed files and metadata about compression. The server-level Enable File Compression parameter allows you to turn off the compression of more files on the server’s compressed volumes.

While file compression is suspended, files that would have been compressed are queued for compression, then are compressed only when (or if) the Enable File Compression parameter is reset to On. Files that are already compressed remain compressed, unless they are decompressed when they are opened and used.

Range: On (default) or Off

The On setting allows file compression activity to occur on volumes where the Compression attribute is enabled. It does not enable the Compression attribute on the server’s volumes.

The Off setting suspends compression on volumes where the Compression attribute is enabled. Immediate compression requests are queued until the value is reset to On, when the files meeting criteria are compressed. The Off setting does not disable the Compression attribute on individual volumes, and it does not prevent you from enabling the Compression attribute for a volume.

Default: On

Minimum Compression Percentage Gain

Sets the minimum percentage a file must compress to remain in a compressed state.

Range: 0 to 50

Default: 20

Maximum Concurrent Compressions

Specifies the maximum concurrent or simultaneous compressions allowed.

Range: 1 to 8

Default: 2

Convert Compressed to Uncompressed Option

Specifies what the file system does with an uncompressed version of a file after the server has decompressed it.

IMPORTANT:Before a compressed file can be opened, there must be sufficient space available on the volume for the uncompressed and compressed copies of the file to coexist while the file is open.

Range: 0, 1 (default), or 2

0 = Always leave the file compressed.

While the file is open, both the uncompressed and compressed copies of the file coexist on the volume. If the file is closed without changes, the uncompressed copy of the file is discarded. If changes are saved, the compressed copy of the file is discarded. After the modified file is closed, it is queued for immediate compression. Sufficient space must be available for both the compressed and uncompressed copies of the file to temporarily coexist on the volume in order for the compression to occur. After successful compression, the uncompressed copy of the modified file is discarded.

1 = Leave the file compressed until second access if it is read only once during the time specified by the Days Untouched Before Compression parameter. This is the default behavior for compression.

While the file is open, both the uncompressed and compressed copies of the file coexist on the volume. The first time that the file is closed without changes in the specified period, the uncompressed copy of the file is discarded. The second time that the file is closed without changes in the specified period, the compressed copy of the file is discarded. If changes are saved, the compressed copy of the file is discarded. The uncompressed file remains uncompressed until it meets requirements for being compressed.

2 = Always leave the file uncompressed.

While the compressed file is open, both the uncompressed and compressed copies of the file coexist on the volume. When the file is closed or when changes are saved, the compressed copy of the file is discarded. The uncompressed file remains uncompressed until it meets requirements for being compressed.

Decompress Percent Disk Space Free to Allow Commit

Specifies the percentage of free disk space required on a volume for file decompression to permanently change compressed files to decompressed. This parameter prevents newly decompressed files from filling up the volume.

Range: 0 to 75

Default: 10

Decompress Free Space Warning Interval

Specifies the time between alerts when the file system is not changing compressed files to decompressed because of insufficient disk space.

Range: 0 seconds to 29 days 15 hours 50 minutes 3.8 seconds

Setting the interval to 0 turns off the alert.

Default: 31 minutes 18.5 seconds

Deleted Files Compression Option

Specifies whether and when deleted files are compressed.

Range: 0, 1, or 2

0 = Do not compress deleted files

1 = Compress deleted files the next day

2 = Compress deleted files immediately

Default: 1

21.2.2 Configuring Server-Level Compression Parameters with Commands

Use the following commands to modify server-level compression parameters. Issue the commands at the NSS Console (nsscon) as the root user. For details about each parameter, see Section 21.2.1, Understanding Server-Level Compression Parameters.

Command

Values

nss /DaysUntouchedBeforeCompression=value

Range: 0 to 100000 (in days)

Default: 14

nss /CompressionDailyCheckStartingHour=value

Range: 0 to 23

Hours are specified by a 24-hour clock: (0=midnight; 23=11 p.m.).

Default Value: 0

nss /CompressionDailyCheckStopHour=value

Supported Values: 0 to 23

Hours are specified by a 24-hour clock: (0=midnight; 23=11 p.m.).

Default Value: 6

nss /(No)EnableFileCompression

To enable compression, enter

nss /EnableFileCompression

To disable compression, enter

nss /NOEnableFileCompression

Supported Values: On (default) or Off

Default Value: On

nss /MinimumCompressionPercentageGain=value

Supported Values: 0 to 50

Default Value: 20

nss /MaximumConcurrentCompressions=value

Supported Values: 1 to 8

Default Value: 2

nss /ConvertCompressedToUncompressedOption=value

Supported Values: 0, 1, or 2

0 = Always leave the file compressed

1 = Leave the file compressed until second access if it is read only once during the time specified by the Days Untouched Before Compression parameter

2 = Always leave the file decompressed

Default Value: 1

nss /DecompressPercentDiskSpaceFreeToAllowCommit=value

Supported Values: 0 to 75

Default Value: 10

nss /DecompressFreeSpaceWarningInterval=value

Supported Values: 0 seconds to 29 days 15 hours 50 minutes 3.8 seconds

Setting the interval to 0 turns off the alert.

Default Value: 31 minutes 18.5 seconds

nss /DeletedFilesCompressionOption=value

Supported Values: 0, 1, or 2

0 = Do not compress deleted files

1 = Compress deleted files the next day

2 = Compress deleted files immediately

Default Value: 1