Note
- For OceanBase Database V4.3.x, this parameter was introduced in OceanBase Database V4.3.1.
- For OceanBase Database V4.2.x, this parameter was introduced in OceanBase Database V4.2.3.
Description
syslog_compress_func specifies the compression algorithm for system log files.
When compression is enabled, the observer.log, rootservice.log, election.log, and trace.log files whose file names are suffixed with timestamps are compressed, and files whose file names are suffixed with .wf are not compressed.
Limitations
Query the parameter
In the
systenant or a user tenant, you can execute theSHOW PARAMETERSstatement to query the parameter or query theGV$OB_PARAMETERSview for the parameter. In thesystenant, you can also query theinformation_schema.PARAMETERSview for the parameter.Modify the parameter
You can modify the parameter only in the
systenant.
Attributes
| Attribute | Description |
|---|---|
| Type | String |
| Default value | none, which specifies not to compress system log files. |
| Value range | none, zstd_1.0, and zstd_1.3.8 |
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify the parameter. |
| Effective upon OBServer node restart | No. The setting takes effect immediately. |
Considerations
After you specify the
syslog_compress_funcparameter, log compression does not start immediately. When the number of logs or disk usage reaches the upper limit, compression starts from the earliest log file. This way, more uncompressed log files are retained, which helps you analyze problems based on logs.After you modify the
syslog_compress_funcparameter, subsequent logs will be compressed by using the specified algorithm. Existing compressed log files are not modified. When you delete log files, the system checks only the timestamps while ignoring file name extensions.The relationship between the
syslog_compress_funcparameter and the syslog_file_uncompressed_count, syslog_disk_size, and max_syslog_file_count parameters is as follows:syslog_compress_func =none:- The
syslog_file_uncompressed_countparameter is invalid. - The
syslog_disk_sizeandmax_syslog_file_countparameters control the maximum size and number of log files.
- The
syslog_compress_func !=none:- The
max_syslog_file_countparameter is invalid. - When the number of log files exceeds the value specified by
syslog_file_uncompressed_count, subsequent log files will be compressed. When the total size of log files is close to the value specified bysyslog_disk_size, the earliest log file is deleted.
- The
Example
Set the compression algorithm for system logs to zstd_1.3.8.
obclient> ALTER SYSTEM SET syslog_compress_func = 'zstd_1.3.8';