BuycPanel Blog

BuycPanel Blog

Latest news and updates

What is Splitlogs Binary?

Posted by Allura on 24 05 2018.

An Overview of the Splitlogs binary in cPanel:

The /usr/local/cpanel/bin/splitlogs binary boosts your resources and performance when you create Apache logs. For example, the /usr/local/cpanel/bin/splitlogs binary can close a file without restarting Apache. Splitlogs Binary improves log processing and bandwidth processing performance.

The default behavior of Apache is to open and write either on a byte log file and an access log file for every virtual host in its configuration file. Due to this, the count of open log files equals twice the count of virtual hosts in Apache’s /usr/local/apache/conf/httpd.conf file. Now in order to decrease Apache’s memory consumption, cPanel & WHM uses Apache’s piped logs functionality with the splitlogs binary to process Apache log data. The splitlogs binary only opens and writes to a single log file when a visitor accesses a virtual host. Now cPanel & WHM runs two occurrences of the splitlogs binary: One to manage the byte log files, and the other to manage the access log files.

The splitlogs binary basically extracts the domain name and port from the Apache logs, and uses this information as a space-separated line in the log file. This information concludes the log file’s name, which the system writes to either a specified directory, or to the default location for Apache logs in the /usr/local/apache/ directory.

Syntax of this Splitlogs Binary

In order to request the splitlogs binary from the command line, use the following syntax:-

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

The Splitlogs configuration file

After cPanel & WHM reconstructs the configuration file of Apache, the system scrutinizes the /var/cpanel/conf/splitlogs.conf file. The system then uses the subjects of this file to set command line arguments for CustomLog directives in Apache’s /usr/local/apache/conf/httpd.conf file. This configuration file covers line-delimited key=value pairs. The key entries are the same as the command line arguments.

Performances and concerns of the Splitlogs binary

  • This splitlogs binary writes the data to its log file whenever it reaches a count of one-thousand of its file handle limit. These log messages specify how often the splitlogs binary opens and closes log files.
    1. If you don’t encounter these messages in the splitlogs binary’s log file, it reduces the –maxopen value.
    2. And if you encounter an unusually high number of these messages in the splitlog binary’s log file, then it increase the –maxopen value.
  • Now the cPanel recommend that you reexamine these values whenever changes in load occur or whenever the number of domains that the system hosts changes.

Conclusion

You have come to know what is splitlogs Binary and how does it work to use this feature in cPanel. Now it’s easy to keep the count of logs in your account and manage them.