OceanBase Database supports synchronous logging. In this mode, a worker thread encapsulates the log content and writes the log file at the same time. This not only downgrades the application performance, but also may lead to log congestion when I/O exceptions occur, which results in SQL RT jitters or even exceptions of the observer process. To address that issue, the asynchronous logging mode is introduced to OceanBase Database. In this mode, a worker thread only encapsulates the log content, and the log file is written by a separate thread. This improves program performance and system stability. You can use the cluster parameter enable_async_syslog to specify whether to enable asynchronous logging. By default, asynchronous logging is enabled.
Notice
We recommend that you enable asynchronous logging for the sake of stability. However, if asynchronous logging is enabled, a small piece of logs immediately before the OBServer node unexpectedly exits may be lost. Therefore, we recommend that you disable asynchronous logging in the test environment.
If exceptions occur in the system, OceanBase Database records a large number of logs. To retain logs for a longer period for easy troubleshooting, OceanBase Database supports log throttling. You can control the log recording rate by specifying the cluster parameter syslog_io_bandwidth_limit. The default value is 30 MB per second. When log throttling is enabled, logs are randomly discarded and the INFO-level log REACH SYSLOG RATE LIMIT is recorded. ERROR-level logs are not throttled.
Notice
Asynchronous logging also consumes CPU resources. In scenarios with extreme performance requirements, such as a big sales event, you can set the log level to ERROR to reduce the number of logs.