# # Movable Type Benchmarking Scripts # Author: Byrne Reese # OVERVIEW These scripts were written to provide a simple load testing and performance testing framework to compare the relative performance between MT3 and MT4. WARNING These scripts should not be mistaken for enterprise class benchmarking or performance analysis. These scripts are far from perfect and should be used only in relative comparisons between two different systems and/or configurations. KNOWN ISSUES - doesn't work in Mac OSX - clock_gettime unimplemented for Time::HiRes FILES run.pl - A script to generate load in a single process wrapper.pl - A wrapper script around run.pl that will launch multiple instances of run.pl to simulate load made by multiple users report.pl - A script that will output a human readable report generated by run.pl generate-content.pl - A script that will populate an MT instance with test data lorem-ipsum.txt - Used by generate-content.pl to generate test data lorem-titles.txt - Used by generate-content.pl to generate test data USAGE Step 1: Generate Load A. Single Thread The run.pl script is responsible for spawning a single process to generate load on an MT instance. The command line parameters are: --verbose A flag to turn on verbose output --debug A flag to turn on even more debugging output --fcgi A flag to invoke Movable Type scripts using a .fcgi file extension --reqs=i The number of requests to generate in this process. When set to 0, or when a value is not provided the script will execute continuously. --v=i The version of Movable Type being invoked. Acceptable values are: "3" and "4" --log=s The log file to output performance stats to. --delay=i The number of seconds to wait in between each request. By default there will be no delay. --zulu=i "Zulu" time is a military term used to refer to a mission start time. This script uses it to establish for logging purposes a shared reference for when a script began measured by the number of seconds since the performance test ran. This is especially useful when measuring performance with multiple concurrent processes. --mode=s, -m=s A toggle between generating reader side load (the commenting script) or author side load (administrative interface). Acceptable values are: "comm" and "app" --tid=i The thread id for this instance. This is used by wrapper.pl when managing concurrent processes for generating load. B. Multiple Threads The wrapper.pl script manages the multiple invocations of the run.pl script and can generate load simulating multiple concurrent users accessing Movable Type. Its command line parameters are: --verbose A flag to turn on verbose output --debug A flag to turn on even more debugging output --fcgi A flag to invoke Movable Type scripts using a .fcgi file extension --v=i The version of Movable Type being invoked. Acceptable values are: "3" and "4" --delay=i The number of seconds to wait in between each request. By default there will be no delay. --wait=i The number of seconds to wait between spawning new processes. --mode=s, -m=s A toggle between generating reader side load (the commenting script) or author side load (administrative interface). Acceptable values are: "comm" and "app" --threads-i The maximum number of processes to generate load from. Step 2: Product a Report The report.pl will processes a .csv file and generate a human readable report on the data it contains. Its command line parameters are: --log=s The log file to be processed. Sample output: Processing mt-comments.cgi 200 - reqs: 1 avg: 0.84489 302 - reqs: 1 avg: 120.30130 500 - reqs: 1 avg: 120.87055 Processing total 200 - reqs: 1 avg: 0.84489 302 - reqs: 1 avg: 120.30130 500 - reqs: 1 avg: 120.87055 max: 120.87055 min: 0.84489 EXAMPLES Invoke a single thread against MT4 and make 10 requests: > MT_HOME=/home/username/cgi-bin/mt perl run.pl -v=4 --mode=app --reqs=10 \ --verbose Invoke 5 threads against MT4 making as many requests as possible in each thread: > MT_HOME=/home/username/cgi-bin/mt perl wrapper.pl -v=4 --mode=app \ --threads=5