Improve CAS logging performance
Published: Jun 17, 2013 · Tags: CAS Log4j Performance
The default configuration does not make use of Log4j buffering capabilities, generating a lot of I/O requests on a busy server.
The configuration is stored in the file
cas-server-webapp/src/main/webapp/WEB-INF/classes/log4j.xml. It uses a RollingFileAppender by default.
This is what it look like, based on CAS 3.5.2 default configuration:
<appender name="cas"></appender> <param name="File" value="cas.log"> <param name="MaxFileSize" value="512KB"> <param name="MaxBackupIndex" value="3"><layout><param name="ConversionPattern" value="%d %p [%c] - %m%n"></layout><param name="BufferedIO" value="TRUE"> <param name="BufferSize" value="32K">
As usual when using buffering, be aware that you might loose data, in case of a crash. So you have to carefully consider whether the trade-off is suitable for your deployment. If you need both performance and security, you might be interested in upgrading your storage unit.