BuycPanel Blog

BuycPanel Blog

Latest news and updates

What is the Splitlogs Binary?

Posted by Allura on 17 12 2018.

Introduction
In order to use the /url/local/cpanel/bin/splitlogsbinary, one must enable the Enable Piped Apache Logs setting in the piped log configuration section of WHM’s Apache Configuration interface( WHM >> Home >> Service Configuration >> Apache Configuration).

The /usr/local/cpanel/bin/splitlogs binary optimize one’s resources and performance after creating Apache logs. As for example, the /usr/local/cpanel/bin/splitlogs binary can close file handles without restarting Apache. It improves log processing and bandwidth processing performance.

Apache’s default behavior is opened and written to both a byte log file and accessing log file for each virtual host in Apache’s configuration file. And because of this, the number of open log files equals twice the number of virtual hosts in Apache’s /usr/local/apache/conf/httpd.conf file. To reduce Apache’s memory consumption, piped logs functionality is used by cPanel & WHM with the splitlogs binary to process Apache log information. The splitlogs binary only opens and writes to a single log file when a visitor accesses a virtual host.

cPanel & WHM runs two instances of the splitlogs binary: firstly to manage the…

Introduction

In order to use the /url/local/cpanel/bin/splitlogsbinary, one must enable the Enable Piped Apache Logs setting in the piped log configuration section of WHM’s Apache Configuration interface( WHM >> Home >> Service Configuration >> Apache Configuration).

The /usr/local/cpanel/bin/splitlogs binary optimize one’s resources and performance after creating Apache logs. As for example, the /usr/local/cpanel/bin/splitlogs binary can close file handles without restarting Apache. It improves log processing and bandwidth processing performance.

Apache’s default behavior is opened and written to both a byte log file and accessing log file for each virtual host in Apache’s configuration file. And because of this, the number of open log files equals twice the number of virtual hosts in Apache’s /usr/local/apache/conf/httpd.conf file. To reduce Apache’s memory consumption, piped logs functionality is used by cPanel & WHM with the splitlogs binary to process Apache log information. The splitlogs binary only opens and writes to a single log file when a visitor accesses a virtual host.

cPanel & WHM runs two instances of the splitlogs binary: firstly to manage the byte log files, and the other to manage the access log files.  The domain name and port is extracted by the splitlogs binary  from the Apache logs, and this information is used as a space-separated line in the log file. This information regulates the log file’s name, which the system either writes to a specified directory, or to the default location for Apache logs in the /usr/local/apache/ directory.

It is to note that if a visitor accesses the shared IP addresses, the splitlogs binary will write only to Apache’s byte and access log file and will not write to the domain log file for the shared IP address.

The Splitlogs Configuration File

The system examines the /var/cpanel/conf/splitlogs.conf file when cPanel & WHM rebuilds Apache’s configuration file. The system makes a use of the contents of this file to set command line arguments for CustomLog directives in Apache’s /usr/local/apache/conf/httpd.conf file.

The configuration file contains line-delimited key=value pairs. The key entries remain same as the command line arguments.

After specifying custom directives for the /var/cpanel/conf/splitlogs.conf file, one must rebuild and restart Apache. One needs to run the following command to do this:

/url/local/cpanel/scripts/rebuildhttpconf/scripts/restartsrv_httpd

Notes About Performance Concerns

  • Whenever the binary reaches 1,000 times, the splitlogsbinary writes information to its log file. These log messages indicate how frequently the splitlogs binary opens and closes log files.
  • If one does not encounter these messages in the splitlogsbinary’s log file, one must reduce the –maxopen
  • If one encounters an unusually high number of these messages in the splitlogbinary’s log file, one must increase the –maxopen
  • We recommend to reevaluate these values whenever changes occur in load or whenever there is a change in the number of domains that the system hosts.

Conclusion

This feature helps a user in many ways as reviewed in this article.