Performance Logging and Monitoring
Movable Type 4.2 contains an extensive logging framework to assist developers in honing in on those areas of the application that are not up to Movable Type’s performance standards.
This framework can also be used by users to help them diagnose the performance of their system and templates on their own, and to then provide Six Apart or a consultant with valuable data to help address issues within their installation.
PerformanceLogging(boolean) - Turns performance logging on and off
PerformanceLoggingThreshold(float) - Sets the threshold at which events will be logged. The value is expressed in seconds and fractions of a second. Any task that takes less then the threshold will not be logged.
PerformanceLoggingPath(string) - Allows you to specify where you would like your log files to place on your local filesystem.
ProcessMemoryCommand(string) - Allows you to specify a command that can be run that will show the memory utilization of a process.
PerformanceLogging 1 PerformanceLoggingPath /var/log/mt/ PerformanceLoggingThreshold 0.5
The ProcessMemoryCommand default setting should work fine on Mac OS, Linux and Windows environments. If you are seeing errors, you may need to customize it for your environment. The default command for each environment is as follows. The command is expected to return the process memory “RSS” size, expressed in kilobytes. If this is set to “0”, this command will not be issued and output in the logs.
ProcessMemoryCommand ps -p $$ -o rss=
ProcessMemoryCommand ps $$ -o rss=
ProcessMemoryCommand tasklist /FI 'PID eq $$' /FO TABLE /NH
When performance logging is enabled, Movable Type will attempt to log as much information as it can during the life-cycle of a request. Doing so will provide valuable information regarding specific areas of the application that could benefit from performance tuning, and will allow users to more easily analyze what within their system may be contributing to poor performance.
Movable Type will attempt to log:
- Information about your operating system, installed software, etc. (this information is logged only once)
- How much memory is being utilized by the process at the beginning and at the end of the request.
- How long it takes to process each template tag, both within the application and on the published blog.
- The URL of the request
- The process ID of the request for easier correlation and log analysis.
Log files will be rotated automatically each day to ensure that files do not get needlessly large and to make it easier on admins to archive older log files.
# Operating System: darwin/9.1.0 # Platform: darwin # Perl Version: v5.10.0 # Web Server: Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.7l DAV/2 PHP/5.2.4 mod_fastcgi/2.4.2 # Database: MySQL/5.0.45 # Database Library: DBI/1.601; DBD/4.005 # App Mode: CGI [Wed Mar 5 10:12:54 2008] localhost pt-times: pid=14596, uri=[/cgi-bin/mt/mt.cgi?__mode=view&_type=entry&id=2733&blog_id=4], mem_start=24327, mem_end=26428, MT::Template::build[include/header.tmpl]=0.04259, MT::Template::build[include/actions_bar.tmpl]=0.01165, MT::Template::build[include/actions_bar.tmpl]=0.01149, MT::Template::build[include/footer.tmpl]=0.01177, MT::Template::build[edit_entry.tmpl]=0.21346, MT::App::CMS::run=0.48057, Total=0.79270 [Wed Mar 5 10:13:12 2008] mtbook.local pt-times: pid=14601, uri=[/cgi-bin/mt/mt.cgi?__mode=view&_type=entry&id=2734&blog_id=4], mem_start=24468, mem_end=26412, MT::Template::build[include/header.tmpl]=0.04200, MT::Template::build[include/actions_bar.tmpl]=0.01175, MT::Template::build[include/actions_bar.tmpl]=0.01143, MT::Template::build[include/footer.tmpl]=0.01069, MT::Template::build[edit_entry.tmpl]=0.15787, MT::App::CMS::run=0.46547, Total=0.72004
We have gone to great lengths to permit only specific information to be logged to the performance log files. Information like passwords, or any information transmitted via a query string is purposefully suppressed. Additionally, all information submitted through a form POST is not logged.