BuycPanel Blog

BuycPanel Blog

Latest news and updates

How to use ‘The Splitlogs Binary’ Interface to Tweak Performance?

Posted by Allura on 28 01 2019.

Introduction
The /usr/local/cpanel/bin/splitlogs binary helps in optimizing one’s resources and performance when the Apache logs are created. Apache’s default behaviour is opened and writen to both a byte log file and an access log file for each virtual host in Apache’s configuration file. The cPanel & WHM runs on two instances of the splitlogs binary: to manage the byte log files, and to manage the access log files and extracts the domain name and port from the Apache logs which is used as a space-separated line in the log file.Syntax
One can use this syntax in order to call the splitlogs binary from the command line:/usr/local/cpanel/bin/splitlogs [arguments]Arguments
Build Arguments–bincheck: verifying the split logs binary built correctly. If built correctly, it returns the BinCheck Ok message and exits. If not, then it exits without a message. Command:/usr/local/cpanel/bin/splitlogs ‑‑bincheckApache Configuration Arguments–dir: store Apache log files (/usr/local/apache file).
–suffix: suffix to use with unencrypted…

Introduction

The /usr/local/cpanel/bin/splitlogs binary helps in optimizing one’s resources and performance when the Apache logs are created. Apache’s default behaviour is opened and writen to both a byte log file and an access log file for each virtual host in Apache’s configuration file. The cPanel & WHM runs on two instances of the splitlogs binary: to manage the byte log files, and to manage the access log files and extracts the domain name and port from the Apache logs which is used as a space-separated line in the log file.

Syntax

One can use this syntax in order to call the splitlogs binary from the command line:

/usr/local/cpanel/bin/splitlogs [arguments]

Arguments

Build Arguments

  1. –bincheck: verifying the split logs binary built correctly. If built correctly, it returns the BinCheck Ok message and exits. If not, then it exits without a message. Command:

/usr/local/cpanel/bin/splitlogs ‑‑bincheck

Apache Configuration Arguments

  1. –dir: store Apache log files (/usr/local/apache file).
  2. –suffix: suffix to use with unencrypted (non-SSL) Apache access logs.
  3. –sslsuffix: suffix to use with SSL Apache access logs.
  4. –sslport: port on which system makes SSL connections.
  5. –main: specify server’s host name.
  6. –mainout: path to default access log file in which system logs requests without a virtual host.

Performance Tweaking Arguments

  1. ‑‑maxopen: specify maximum number of log files that binary can open at the same time.
  2. ‑‑buffer: whether to enable the buffered file writing (yes to enable, no to disable the buffered file writing).

More About –maxopen Argument

If it is set on a low value, the binary will open and close files more often and reduce the performance. If set on a high vale, binary will require more system resources and operating system file handle, increasing the overall system load. One can use the current pattern of access to sites on one’s system for determining the –maxopen value.

More About –buffer Argument

It helps in specifying the need to enable buffered file writing. If enabled, binary will write to individual log files faster. In that case, it will require more memory for each open log file. If disabled, binary will require substantially less memory.

The Splitlogs Configuration File

When Apache’s configuration file is rebuilt, the system will examine the /var/cpanel/conf/splitlogs.conf file and will use the contents of this file to set command line arguments for CustomLog directives in Apache’s /usr/local/apache/conf/httpd.conf file. The file will contain line-delimited key=value pairs.

Notes About Performance Concerns

If not encountered, it will reduce the –maxopen value, and if encountered, it will increase the –maxopen value. It is recommended to re-evaluate these values while changes in load occurs or the number of domains changes that the system hosts.

Conclusion

All information about split logs binary to tweak performance is outlined in this article.