You need to enable JavaScript to run this app.
Torch Log Service

Torch Log Service

Copy page
Download PDF
Manage LogCollector
Configure LogCollector startup parameters
Copy page
Download PDF
Configure LogCollector startup parameters
To prevent LogCollector from excessively consuming server resources and affecting the normal operation of other services, TLS has imposed limits on LogCollector’s collection performance. If you need to increase LogCollector’s collection performance, you can adjust the CPU and memory thresholds. This topic introduces how to configure LogCollector startup parameters.​
Scenarios to configure​
Modify LogCollector resource settings in the following scenarios.​
  • A large number of log files need to be collected (such as collecting more than 100 files simultaneously) and it leads to high memory usage.​
  • Large log data traffic leads to high LogCollector CPU usage.​
  • There is a collection delay when querying logs.​
  • Certain LogCollector restrictions can not meet your business requirements.​
Recommended parameter values​
Based on practical experience, we recommend the following parameter configuration for collecting regular JSON files. The performance of complete regular expression and separator modes is similar to JSON mode, while single-line full text and multi-line full text modes offer twice the performance of JSON mode. The complexity of data and the number of files to be collected affect CPU and memory consumption. Please adjust as needed based on the table below and your actual situation.​
  • Host environment​
  • ​
    Parameters​
    Default collection rate​
    Collection rate exceeds 20 MB/s​
    Collection rate exceeds 40 MB/s​
    Collection rate exceeds 60 MB/s​
    max_procs​
    1​
    2​
    3​
    4​
    max_mem​
    1GiB​
    2GiB​
    3GiB​
    4GiB​
    ​
  • Container environment​
  • ​
    Parameters​
    Default collection rate​
    Collection rate exceeds 20 MB/s​
    Collection rate exceeds 40 MB/s​
    Collection rate exceeds 60 MB/s​
    max_procs​
    1​
    2​
    3​
    4​
    max_mem​
    1GiB​
    2GiB​
    3GiB​
    4GiB​
    resources.limits.cpu​
    1000m​
    2000m​
    3000m​
    4000m​
    resources.limits.memory​
    1GiB​
    2GiB​
    3GiB​
    4GiB​
    ​
  • LogCollector performance limits are shown in the table below.​
Description​
Due to differences between the testing and production environments, actual collection performance may vary.​
  • ​
    Collection mode​
    Performance limit​
    Single-line full text mode​
    300 MB/s​
    Multi-line full text mode​
    200 MB/s​
    JSON mode​
    150 MB/s​
    Separator mode​
    120 MB/s​
    Single-line complete regex mode​
    100 MB/s​
    Multi-line complete regex mode​
    100 MB/s​
    ​
Set startup parameters​
  1. Modify the configuration file.​
  • The file path details are shown in the table below:​
  • ​
    LogCollector version​
    Installation scenario​
    File path​
    LogCollector v2.2.0 and later versions​
    Host scenario​
    /usr/local/logcollector/etc/logcollector.yml​
    ​
    Container scenario​
    Modify the LogCollector configuration file by updating the configmap.​
    ​
    kubectl edit configmap -n kube-syetem logcollector-config​
    ​
    Logcollector versions before v2.2.0​
    Host scenario​
    /usr/local/filebeat-7.12.0/etc/filebeat.yml​
    ​
    Container scenario​
    Modify the LogCollector configuration file by updating the configmap.​
    ​
    kubectl edit configmap -n kube-syetem logcollector-config​
    ​
    ​
Description​
To view LogCollector version, see 2. View software version.​
  1. Set startup parameters based on your needs.​
  • Startup parameters example: ​
  • ​
    daemonset_mode: true​
    autodiscover:​
    providers:​
    - type: kubernetes​
    cleanup_timeout: 15s​
    ​
    max_procs: 2​
    max_mem: 2GiB​
    log_max_bytes: 512KiB​
    ...​
    ​
Description​
The table below lists the commonly used startup parameters you should pay attention to; for those not listed, keep the default configuration.​
  • ​
    Configuration item​
    Type​
    Description​
    Example​
    max_procs​
    int​
    CPU threshold allowed for LogCollector.​
    • Value range: from one to the number of CPU cores on this machine.​
    • Default value: 2.​
    max_procs is a soft limit, and the actual CPU usage by LogCollector may exceed this value.​
    max_procs: 2​
    max_mem​
    string​
    Memory threshold for LogCollector​
    • Value range: 256 MiB – 8 GiB​
    • Default value: 2GiB​
    max_mem is a soft limit, and the actual memory used by LogCollector may exceed this value.​
    max_mem: 2GiB​
    log_max_bytes​
    string​
    Maximum length for each log entry​
    • Value range: 16 KiB – 8 MiB​
    • Default value: 512KiB​
    log_max_bytes: 512KiB​
    autodiscover​
    autodiscover​
    Container discovery module. For more details, see the table below.​
    ​
    autodiscover:​
    providers:​
    - type: kuberbetes​
    cleanup_timeout: 15s​
    ​
    input.log.enable_inotify​
    bool​
    This configuration determines whether to enable or disable inotify mechanism.​
    • true (default): Enable inotify to monitor logs.​
    • false: Disable the inotify mechanism. This may result in log files with a survival time of less than 20 seconds being missed for collection.​
    input.log.enable_inotify:false​
    ​
  • autodiscover​
  • ​
    Parameters​
    Type​
    Description​
    Providers​
    Array of Object​
    Specific provider for container discovery. Currently, only Kubernetes is supported. For more details, see the table below.​
    ​
  • kubernetes​
  • ​
    Parameters​
    Type​
    Description​
    Example​
    cleanup_timeout​
    string​
    Time delay before ending collection after Pod terminates. The default value is 15s.​
    cleanup_timeout: 15s​
    ​
​
Last updated: 2026.05.26 11:12:11