Infrastructure Management server logs are not rolling automatically causing performance issues
The <InfrastructureManagement_Install_Location>\pw\apache\logs\ contains log files which are not rolling automatically. This can cause performance issues on the host on which Infrastructure Management is installed.
To avoid this problem, you need to configure automatic rolling of logs on the Infrastructure Management host. If you are operating in an HA environment, you need to make the configuration changes on both the primary server and the secondary server.
To configure automatic rolling of logs
- Stop the Apache server by running the
pw p e httpd
command. - Delete all the existing log files available in the following directory:
- (Windows)<InfrastructureManagement_Install_Location>\pw\apache\logs\
- (Linux)<InfrastructureManagement_Install_Location>/pw/apache/logs/
- Take a backup of the httpd-proxy.conf file located at:
- (Windows) <InfrastructureManagement_Install_Location>\pw\apache\conf\extra\
- (Linux) <InfrastructureManagement_Install_Location>/pw/apache/conf/extra/
Note
Ensure that you place the backed up file in a folder outside the Infrastructure Management installation directory.
Edit the httpd-proxy.conf file.
For each of the log files under <InfrastructureManagement_Install_Location>\pw\apache\logs\ (for which you want to configure automatic rolling), add the following line at the top of the httpd-proxy.conf file:
(Windows) CustomLog "|bin/rotatelogs.exe -n 10 logs/<logFileName> 10M" combined
(Linux) CustomLog "|<InfrastructureManagement_Install_Location>/pw/apache/bin/rotatelogs -n 10 logs/<logFileName> 10M" combined
In the preceding lines, the following definitions apply:
- <InfrastructureManagement_Install_Location> refers to the directory location where you have installed Infrastructure Management.
- -n parameter indicates the number of files you want to keep before rolling over logs. In this case, the number of files is set to 10.
For example, with -n 3, three logs will be created, Log1, Log2, and Log3, and the next time, Log1 will be overwritten with the new log details. - <logFileName> indicates the name of the log file for which you want to configure automatic rolling. For example, error_log.
- 10M indicates the maximum file size (in MB) after which a new file must be created. In this case, the maximum file size is set to 10 MB.
For example, when log file 1 reaches the limit of 10 MB, a new log file 2 is created.
Note
You do not need to add this line for the ajp.log file as it is already exists.
Example of lines to be added for different log files on LinuxCustomLog "|<InfrastructureManagement_Install_Location>/pw/apache/bin/rotatelogs -n 10 logs/deflate.log 10M" combined
CustomLog "|<InfrastructureManagement_Install_Location>/pw/apache/bin/rotatelogs -n 10 logs/ssl_request_log 10M" combined
CustomLog "|<InfrastructureManagement_Install_Location>/pw/apache/bin/rotatelogs -n 10 logs/error_log 10M" combined
CustomLog "|<InfrastructureManagement_Install_Location>/pw/apache/bin/rotatelogs -n 10 logs/error.log 10M" combined
CustomLog "|<InfrastructureManagement_Install_Location>/pw/apache/bin/rotatelogs -n 10 logs/install.log 10M" combined
- Save the file.
Start the Apache server by running the
pw p s httpd
command.
Comments
Updating httpd-proxy.conf with multiple log file locations as instructed in this procedure will tell proxy module to write log data to multiple log files. This is incorrect log configuration.
In TSIM 11.0.0.1 there are the following Apache log files enabled by default:
access_log - httpd.conf should be updated and line for this log configuration should look like this: CustomLog "|/usr/pw/apache/bin/rotatelogs -n 10 /usr/pw/apache/logs/access_log 10M" common
deflate.log - httpd.conf should be updated and line for this log configuration should look like this: CustomLog "|/usr/pw/apache/bin/rotatelogs -n 10 /usr/pw/apache/logs/deflate.log 10M" deflate env=!image-request
error_log - httpd-ssl.conf file should be updated and line for this log configuration should look like this: CustomLog "|/usr/pw/apache/bin/rotatelogs -n 10 /usr/pw/apache/logs/error_log 10M" combined
ssl_request_log – httpd-ssl.conf file should be updated and line for this log configuration should look like this: CustomLog "|/usr/pw/apache/bin/rotatelogs -n 10 /usr/pw/apache/logs/ssl_request_log 10M" \
ajp.log – already configured in httpd-proxy.conf
For more information see Apache documentation http://httpd.apache.org/docs/current/logs.html
Thank you for your comment! The solution that you proposed did not work in our environment. The R&D team is still validating this scenario. Once we have the results, we'll update the doc.
If you want I can share httpd.conf and httpd-ssl.conf with correct and working configuration. Please contact me via email because I cannot attach files here.
Log in or register to comment.