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/
- 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.
Example of lines to be added for different log files on Linux
CustomLog "|<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.